Skip to content

Commit c61763d

Browse files
vokuondrejmirtes
authored andcommitted
faster TypeCombinator::remove()
1 parent 094ff78 commit c61763d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Type/TypeCombinator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static function remove(Type $fromType, Type $typeToRemove): Type
9595
$lowerPart = $removeValueMin !== null ? IntegerRangeType::fromInterval(null, $removeValueMin, -1) : null;
9696
$upperPart = $removeValueMax !== null ? IntegerRangeType::fromInterval($removeValueMax, null, +1) : null;
9797
if ($lowerPart !== null && $upperPart !== null) {
98-
return self::union($lowerPart, $upperPart);
98+
return new UnionType([$lowerPart, $upperPart]);
9999
}
100100
return $lowerPart ?? $upperPart ?? new NeverType();
101101
}

0 commit comments

Comments
 (0)