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

Generic/LowerCaseType: add support for examining DNF types #478

Merged
merged 1 commit into from
May 6, 2024

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented May 2, 2024

Description

The Generic.PHP.LowerCaseType sniff needs to be updated to also handle non-lowercase types which are part of a DNF type declaration.

This commit updates the processUnionType() method to not only examine union types, but to examine all multi-token types and to do so in a slightly more performant manner and calls that method now for all multi-token type declarations.

Note: The method name now doesn't properly cover the functionality anymore, however, renaming the method would be a breaking change as the class is not final and the method not private.

Includes unit tests.

Suggested changelog entry

The Generic.PHP.LowerCaseType sniff will now enforce lowercase keyword based types for types used in PHP 8.2+ DNF types.

Related issues/external references

Related #105, #387, #461, #471, #472, #473

Closes #105

The `Generic.PHP.LowerCaseType` sniff needs to be updated to also handle non-lowercase types which are part of a DNF type declaration.

This commit updates the `processUnionType()` method to not only examine union types, but to examine all multi-token types and to do so in a slightly more performant manner and calls that method now for all multi-token type declarations.

Note: The method name now doesn't properly cover the functionality anymore, however, renaming the method would be a breaking change as the class is not `final` and the method not `private`.

Includes unit tests.

Related to 105

Closes 105
@jrfnl jrfnl force-pushed the php-8.2/generic-lowercasetype-check-dnf-types branch from 66ae57f to 9bf4e15 Compare May 6, 2024 02:58
@jrfnl
Copy link
Member Author

jrfnl commented May 6, 2024

Rebased without changed. Merging once the build has passed.

@jrfnl jrfnl merged commit 0d143c0 into master May 6, 2024
48 checks passed
@jrfnl jrfnl deleted the php-8.2/generic-lowercasetype-check-dnf-types branch May 6, 2024 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support new PHP 8.2 syntaxes
1 participant