diff --git a/src/types.php b/src/types.php index 3ada628..3a493f0 100644 --- a/src/types.php +++ b/src/types.php @@ -232,6 +232,10 @@ public static function intRange(?int $min = null, ?int $max = null): Type return self::int; } + if ($min === $max) { + return self::literalValue($min); + } + return new IntRangeType($min, $max); }