New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the return types of round()/ceil()/floor() #729
Fix the return types of round()/ceil()/floor() #729
Conversation
I'm not sure what the failing tests are telling me. They seem unrelated to this change but I don't have a good enough understanding of PHPStan internals to know for sure. Guidance appreciated. |
I'd love to use this, can you please rebase and make the build green? Thank you. |
ada463a
to
36fc0d5
Compare
There's still a lot of failures. |
It's difficult to determine what's failing due to this change and what's also failing in master currently. I'll wait until master is green then take another look. |
Yeah, you can safely rebase now :) |
36fc0d5
to
d2b50e3
Compare
930a5de
to
d916dd3
Compare
Thank you! |
Thanks for helping get it over the finishing line :-) |
On PHP < 8 these functions return boolean false when the
$num
parameter is an array: https://3v4l.org/J9KkPPHPStan correctly reports an error if the type of
$num
is known and notint|float
, but it's possible for the type not to be known.This playground example is as good as I could manage: https://phpstan.org/r/59f77cf2-a658-4f2b-9630-80c778714ab2