phpstan
phpstan copied to clipboard
@var variable not found if initialized in a test
Bug report
when a variable designated in a @var type $variable
phpdoc comment is initialized in a test, phpstan fails to find it :
Variable $variable in PHPDoc tag @var does not exist.
Code snippet that reproduces the problem
https://phpstan.org/r/9566e566-3fb7-40a3-9620-fb08ab0791b1
Expected output
no error
Did PHPStan help you today? Did it make you happy in any way?
Absolutely ! my code gets cleaner and is is satisfying.