diff --git a/src/types.php b/src/types.php index 3a493f0..2809afa 100644 --- a/src/types.php +++ b/src/types.php @@ -233,6 +233,7 @@ public static function intRange(?int $min = null, ?int $max = null): Type } if ($min === $max) { + /** @var int $min */ return self::literalValue($min); } @@ -290,6 +291,16 @@ public static function literalValue(bool|int|float|string $value): Type return new LiteralValueType($value); } + /** + * @template TType + * @param Type $type + * @return Type + */ + public static function nonEmpty(Type $type): Type + { + return new NonEmptyType($type); + } + /** * @template TKey * @template TValue