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
Consider the below MRE, which was OK for phpcs-variable-analysis v2.11.12, but receives a warning in v2.11.14 for the part of the code on the last line (between question mark and colon).
Warning: Variable $cls is undefined. (VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable)
Note that PHP (8.0) has no issue with the code and it works as expected. As far as I can tell, it might be connected to PR #296.
Hm... yes, it looks like the scope detection for arrow functions is still buggy. Even before #296, it would have broken for versions of PHP/phpcs that did not support arrow functions, so in a way this is good to discover.
Consider the below MRE, which was OK for phpcs-variable-analysis
v2.11.12
, but receives a warning inv2.11.14
for the part of the code on the last line (between question mark and colon).Note that PHP (8.0) has no issue with the code and it works as expected. As far as I can tell, it might be connected to PR #296.
This workaround can fix it for now.
The text was updated successfully, but these errors were encountered: