Skip to content

Commit 4049da2

Browse files
committed
Fixed restricted values for CompoundType
1 parent 2da20b0 commit 4049da2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/type/CompoundType.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ class CompoundType extends Type {
1818
* @param array<Type> $types
1919
*/
2020
private function __construct(array $types) {
21-
parent::__construct();
22-
$this->types = $types;
2321
$restrictedValues = [];
2422
foreach ($types as $type) {
2523
if($type->getRestrictedValues() !== null) {
@@ -29,7 +27,8 @@ private function __construct(array $types) {
2927
break;
3028
}
3129
}
32-
$this->setRestrictedValues($restrictedValues);
30+
parent::__construct($restrictedValues);
31+
$this->types = $types;
3332
}
3433

3534
public static function buildFromTypes(array $types): Type {

0 commit comments

Comments
 (0)