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
expects array<int>, array<int>|int<min, -1>|int<1, max> given #5749
Comments
Hi, this is very complicated code and it's hard to fix this scenario. It's not even obvious for me what should happen for I think I wrote an equivalent code to yours that's much better understandable by PHPStan: https://phpstan.org/r/ba7ccf3e-6f9b-4920-b46c-056719ca3445 But still, I think you might have an unwanted bug on your hands. |
Thanks for the answer. 💯 I first rewrote the code and allow only |
@voku After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-34: Parameter #1 $array of static method ActiveRowFactory::dbarray_int() expects array<int>, array<int>|int<min, -1>|int<1, max> given.
+34: Parameter #1 $array of static method ActiveRowFactory::dbarray_int() expects array<int>, array<int>|int|int given. Full report
|
@voku After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-34: Parameter #1 $array of static method ActiveRowFactory::dbarray_int() expects array<int>, array<int>|int<min, -1>|int<1, max> given.
+No errors |
Fixed: phpstan/phpstan-src@cc6655f |
Closes phpstan/phpstan#5893 Closes phpstan/phpstan#6070 Closes phpstan/phpstan#5869 Closes phpstan/phpstan#6212 Closes phpstan/phpstan#6262 Closes phpstan/phpstan#6266 Closes phpstan/phpstan#6023 Closes phpstan/phpstan#6108 Closes phpstan/phpstan#6020 Closes phpstan/phpstan#1746 Closes phpstan/phpstan#1516 Closes phpstan/phpstan#6174 Closes phpstan/phpstan#6112 Closes phpstan/phpstan#5749 Closes phpstan/phpstan#5969 Closes phpstan/phpstan#5295 Closes phpstan/phpstan#5675 Closes phpstan/phpstan#5369 Closes phpstan/phpstan#6699 Closes phpstan/phpstan#6505
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
array<int>
should includearray<int>, array<int>|int<min, -1>|int<1, max>
Code snippet that reproduces the problem
https://phpstan.org/r/3e6501a6-06a3-4394-b559-342550be708b
Did PHPStan help you today? Did it make you happy in any way?
PHPStan is an excellent tool to increase the code quality step-by-step, I like it.
The text was updated successfully, but these errors were encountered: