getMin(); $removeValueMax = $typeToRemove->getMax(); } else { $removeValueMin = $typeToRemove->getValue(); $removeValueMax = $typeToRemove->getValue(); } $lowerPart = $removeValueMin !== null ? IntegerRangeType::fromInterval(null, $removeValueMin, -1) : null; $upperPart = $removeValueMax !== null ? IntegerRangeType::fromInterval($removeValueMax, null, +1) : null; if ($lowerPart !== null && $upperPart !== null) { return new UnionType([$lowerPart, $upperPart]); } return $lowerPart ?? $upperPart ?? new NeverType(); } return null; } }