Add non-zero int type#2449
Add non-zero int type#2449ondrejmirtes merged 2 commits intophpstan:1.10.xfrom PrinsFrank:add-non-zero-int
Conversation
|
You've opened the pull request against the latest branch 1.11.x. If your code is relevant on 1.10.x and you want it to be released sooner, please rebase your pull request and change its target to 1.10.x. |
|
Hi, how common is to require all integers except zero? You can already express them today with As for floats - we don't have a FloatRangeType, it'd have to be added, and update all arithmetic operations in order to correctly calculate it. |
|
I've used that exact annotation in three different projects now, so I thought It'd be time to add an alias. If you don't think it's needed I can still use the full written form, I just thought it would be nice to have this alias. Would you see value in adding float ranges? I would be happy to contribute something more and check if I can implement this in a new PR. |
|
Hi, yes, I see value in it, you can definitely try it out :) Thank you. |
For integers and floats that are used as divisors, a non-zero integer/float has to be used. This was easy to implement with integer ranges, but not easy for float ranges. How could we add that?