Skip to content

Commit

Permalink
faster TypeCombinator::remove()
Browse files Browse the repository at this point in the history
  • Loading branch information
voku authored and ondrejmirtes committed Oct 28, 2021
1 parent 094ff78 commit c61763d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Type/TypeCombinator.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static function remove(Type $fromType, Type $typeToRemove): Type
$lowerPart = $removeValueMin !== null ? IntegerRangeType::fromInterval(null, $removeValueMin, -1) : null;
$upperPart = $removeValueMax !== null ? IntegerRangeType::fromInterval($removeValueMax, null, +1) : null;
if ($lowerPart !== null && $upperPart !== null) {
return self::union($lowerPart, $upperPart);
return new UnionType([$lowerPart, $upperPart]);
}
return $lowerPart ?? $upperPart ?? new NeverType();
}
Expand Down

0 comments on commit c61763d

Please sign in to comment.