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:
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!
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:
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!