File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ public static function union(Type ...$types): Type
371
371
}
372
372
}
373
373
374
- return new UnionType ($ types );
374
+ return new UnionType ($ types, true );
375
375
}
376
376
377
377
/**
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ class UnionType implements CompoundType
42
42
* @api
43
43
* @param Type[] $types
44
44
*/
45
- public function __construct (private array $ types )
45
+ public function __construct (private array $ types, private bool $ normalized = false )
46
46
{
47
47
$ throwException = static function () use ($ types ): void {
48
48
throw new ShouldNotHappenException (sprintf (
@@ -74,6 +74,11 @@ public function getTypes(): array
74
74
return $ this ->types ;
75
75
}
76
76
77
+ public function isNormalized (): bool
78
+ {
79
+ return $ this ->normalized ;
80
+ }
81
+
77
82
/**
78
83
* @return Type[]
79
84
*/
@@ -836,7 +841,7 @@ public function tryRemove(Type $typeToRemove): ?Type
836
841
*/
837
842
public static function __set_state (array $ properties ): Type
838
843
{
839
- return new self ($ properties ['types ' ]);
844
+ return new self ($ properties ['types ' ], $ properties [ ' normalized ' ] );
840
845
}
841
846
842
847
/**
You can’t perform that action at this time.
0 commit comments