Skip to content
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

PHP 8.1 | Generic/LowerCaseKeyword: simplify registered tokens + add enum support #3574

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Mar 31, 2022

This is a PR to simplify maintenance of this sniff.

Since PR #3484, the Tokens class contains a $contextSensitiveKeywords property which largely overlaps with the list of tokens registered for this sniff.

All tokens in that list should always be included in the targets for this sniff anyway, so we may as well leverage the new token array.

Includes adding the new custom T_ENUM_CASE token to the list of additional tokens to take into account.

Includes unit test.

…enum support

This is a PR to simplify maintenance of this sniff.

Since PR 3484, the `Tokens` class contains a `$contextSensitiveKeywords` property which largely overlaps with the list of tokens registered for this sniff.

All tokens in that list should always be included in the targets for this sniff anyway, so we may as well leverage the new token array.

Includes adding the new custom `T_ENUM_CASE` token to the list of additional tokens to take into account.

Includes unit test.
@gsherwood gsherwood added this to the 3.7.0 milestone Apr 17, 2022
@gsherwood gsherwood merged commit 7109f0c into squizlabs:master Apr 18, 2022
@gsherwood
Copy link
Member

Thanks for enum case support and taking the time for the cleanup

@jrfnl jrfnl deleted the feature/generic-lowercasekeyword-simplify-and-enum-support branch April 18, 2022 01:08
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.

2 participants