flow
flow copied to clipboard
[Proposal]: IntegerRangeType
Describe the Proposal
PHPStan allows to define integer types as int<min,max>, would be nice to be able to do the same on the code level since currently there is no way to narrow the types when int<1, max> is required somewhere
API Adjustments
type_integer_range(1, PHP_INT_MAX) - integer<1, max>
Are you intenting to also work on proposed change?
None
Are you interested in sponsoring this change?
None
Integration & Dependencies
No response
Unfortunately it seems that PHPStan does not understand int<TMin, TMax> https://phpstan.org/r/5097e96a-5d7d-43f6-b882-5178d8abed49 so this needs to go on hold for now :(
Reference: https://github.com/phpstan/phpstan/issues/13174