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
Thanks for noticing! It turns out that while the sniff does ignore certain variables (the fix in #53), it doesn't actually recognize class property definitions explicitly, which I think was leading to this bug. #77 should fix this.
Hey,
phpcs: PHP_CodeSniffer version 3.4.1 (stable) by Squiz (http://www.squiz.net)
sirbrillig/phpcs-variable-analysis: v2.6.0
It looks like anonymous classed aren't fully supported.
I did notice this issue: #52 which is referenced in this pr: https://github.com/sirbrillig/phpcs-variable-analysis/pull/53/files
Both changes in
VariableAnalysis/Lib/Helpers.php
andVariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php
are in my local installation.However, this heavily simplified file:
Shows the following error:
13 | WARNING | Variable $property is undefined.
A
var_export($token)
onvendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Lib/Helpers.php:196
shows:I'm not that knowledgable about the inner workings of the code sniffer, but maybe you can reproduce the issue and possibly fix it?
Thanks anyway!
The text was updated successfully, but these errors were encountered: