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
Config treatPhpDocTypesAsCertain
is not honored for int ranges
#7795
Comments
Sounded so familiar, I think this is a duplicate of #7075 :) |
Totally a duplicated, I actually searched but i stopped to the first hits, didn't go as far as april 2021.. and it's marked as easy fix :) |
maybe you could give it a try? :) looks like Ondrej added some infos already |
@herndlm I did 😄 Can you test it? It should work as is but i won't know if it breaks something.. it's working for me. |
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. |
Given following snippet:
https://phpstan.org/r/ace27b7e-79a6-40cc-8888-e27b49a46073
It correctly reports that the condition is always true when
treatPhpDocTypesAsCertain
istrue
, but if set tofalse
then it should not report the error.This is a legit safety check for the following use case: I want to specify the actual most strict type possible, to detect bad usage from calling library, but at the same time I have to put the check in place to avoid bad things to happen as PHP will only enforce the int type hinting.
The text was updated successfully, but these errors were encountered: