You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The variable is "always true" and "might not be defined" at the same time, which doesn't make any sense to me. Without the "foreach" phpstan handles the code correctly.
P.S.: Thank You for awesome tool (phpstan), which helps me with refactoring legacy code a lot.
The text was updated successfully, but these errors were encountered:
The thing that was so curious to me about this issue is that dumpTypedoes infer the correct type in a lot of cases, but the "might not be defined" warning is still emitted (I misunderstood dumpType -- it seems that certainty of the type doesn't guarantee that it's defined).
I have a lot of logic like this in templating code, which can't always be reorganized to circumvent the warning. I'm crossing my fingers for a fix some day from one of our amazing maintainers! ❤️
Code snippet here:
https://phpstan.org/r/37400131-6bac-49dd-9088-5fa3614957bf
The variable is "always true" and "might not be defined" at the same time, which doesn't make any sense to me. Without the "foreach" phpstan handles the code correctly.
P.S.: Thank You for awesome tool (phpstan), which helps me with refactoring legacy code a lot.
The text was updated successfully, but these errors were encountered: