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.
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