Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Apr 5, 2025

Description

The Generic.PHP.LowerCaseConstant sniff is supposed to flag uppercase use of the true/false/null constants and its sister-sniff UpperCaseConstant flags the lowercase variants. Both sniffs, however, are supposed to ignore the use of these keywords in type declarations - which may have their own rules.

Some previous PRs already fixed most of the issues with that (#119, #330), but it looks like DNF-types in property declarations were not yet handled correctly.

Fixed now.

Includes tests.

Suggested changelog entry

Generic.PHP.LowerCaseConstant and Generic.PHP.UpperCaseConstant will now correctly ignore DNF types for properties.

…perty types The `Generic.PHP.LowerCaseConstant` sniff is supposed to flag uppercase use of the `true`/`false`/null` constants and its sister-sniff `UpperCaseConstant` flags the lowercase variants. Both sniffs, however, are supposed to **_ignore_** the use of these keywords in type declarations - which may have their own rules. Some previous PRs already fixed most of the issues with that (119, 330), but it looks like DNF-types in property declarations were not yet handled correctly. Fixed now. Includes tests.
@jrfnl jrfnl added this to the 3.12.2 milestone Apr 5, 2025
@jrfnl jrfnl merged commit 3c90cda into master Apr 9, 2025
61 checks passed
@jrfnl jrfnl deleted the feature/generic-lower-uppercaseconstants-support-dnf-types branch April 9, 2025 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment