sirbrillig / phpcs-variable-analysis

Find undefined and unused variables with the PHP Codesniffer static analysis tool.
Other
135 stars 14 forks source link

Allow non-enum tokens called 'enum' #293

Closed sirbrillig closed 1 year ago

sirbrillig commented 1 year ago

When enum detection was added in #289 it used the string 'enum' to detect enums in versions of PHPCS where the tokenizer is unaware of enums. However, this accidentally caused it to detect non-enums as well if they have the content 'enum'.

In this diff we make enum detection safely fail if the token does not look like an enum.

Fixes https://github.com/sirbrillig/phpcs-variable-analysis/issues/292

Levivb commented 1 year ago

such speed 😁