-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
phpstan/phpstan-src
#1950Labels
Milestone
Description
Bug report
Dependent variable support (added in 0.12.64) dosen’t work properly if the variable used in the dependency condition is referenced in an additional condition before the dependent variable check kicks in.
Code snippet that reproduces the problem
Here’s two simple examples:
- https://phpstan.org/r/24f3cfa0-0f00-4f1d-9879-4aff51b7eee2
- https://phpstan.org/r/24b3989b-3b74-4e47-9b3f-ac3e6e519065
Expected output
There shouldn’t be any reported errors here.
Did PHPStan help you today? Did it make you happy in any way?
I was prepared to have to start refactoring all the places where we are using dependent variables to make PHPStan happy, and was pleasantly surprised to find that there’s some basic support for it already!