It appears that at least in some versions of phpcs, the arrow function scope detection is not correct. It incorrectly considers a closing square bracket (]) inside the body of an arrow function to close that arrow function's scope.
We already have custom logic for finding arrow function scopes so that it will work for versions of PHP/phpcs which do not support arrow functions. In this PR we remove the simpler path and rely only on the custom logic.
It appears that at least in some versions of phpcs, the arrow function scope detection is not correct. It incorrectly considers a closing square bracket (
]
) inside the body of an arrow function to close that arrow function's scope.We already have custom logic for finding arrow function scopes so that it will work for versions of PHP/phpcs which do not support arrow functions. In this PR we remove the simpler path and rely only on the custom logic.
Fixes https://github.com/sirbrillig/phpcs-variable-analysis/issues/295