Skip to content

Allow non-enum tokens called 'enum' #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 13, 2023
Merged

Conversation

sirbrillig
Copy link
Owner

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 #292

@Levivb
Copy link
Contributor

Levivb commented Mar 13, 2023

such speed 😁

@sirbrillig sirbrillig merged commit d8a00fb into 2.x Mar 13, 2023
@sirbrillig sirbrillig deleted the fix/enum-detection-for-non-enums branch March 13, 2023 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

method call called 'enum' causes an "Cannot find enum start at position" error
2 participants