Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rajyan committed Dec 20, 2022
1 parent 55d27b3 commit 092264b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Type/TypeCombinator.php
Expand Up @@ -107,7 +107,6 @@ public static function union(Type ...$types): Type
return new NeverType();
}

$arrayTypes = [];
$benevolentTypes = [];
$benevolentUnionObject = null;
// transform A | (B | C) to A | B | C
Expand Down Expand Up @@ -136,8 +135,9 @@ public static function union(Type ...$types): Type
$innerTypes = $types[$i]->getTypes();
foreach ($innerTypes as $key => $innerType) {
if ($innerType->isArray()->yes()) {
$arrayTypes[] = $innerType;
$types[] = $innerType;
unset($innerTypes[$key]);
$typesCount++;
}
}
if (count($innerTypes) === 0) {
Expand All @@ -164,6 +164,7 @@ public static function union(Type ...$types): Type
return $types[0];
}

$arrayTypes = [];
$scalarTypes = [];
$hasGenericScalarTypes = [];
for ($i = 0; $i < $typesCount; $i++) {
Expand Down

0 comments on commit 092264b

Please sign in to comment.