Skip to content

Commit a86da0b

Browse files
staabmondrejmirtes
authored andcommitted
UnionType: inline array_map() call
1 parent b87b4ed commit a86da0b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Type/UnionType.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,12 @@ private function notBenevolentUnionResults(callable $getResult): TrinaryLogic
12341234
*/
12351235
protected function unionTypes(callable $getType): Type
12361236
{
1237-
return TypeCombinator::union(...array_map($getType, $this->types));
1237+
$newTypes = [];
1238+
foreach($this->types as $type) {
1239+
$newTypes[] = $getType($type);
1240+
}
1241+
1242+
return TypeCombinator::union(...$newTypes);
12381243
}
12391244

12401245
/**

0 commit comments

Comments
 (0)