Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Apr 9, 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.

This commit adds support for skipping over the types in PHP 8.4 final property declarations.

Includes tests.

Suggested changelog entry

Added support for PHP 8.4 final properties to the following sniffs:

  • Generic.PHP.LowerCaseConstant
  • Generic.PHP.UpperCaseConstant

Related issues/external references

Related to #734, follow up to #834 and #907

…operties 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. This commit adds support for skipping over the types in PHP 8.4 `final` property declarations. Includes tests.
Copy link
Contributor

@DanielEScherzer DanielEScherzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching

@jrfnl jrfnl merged commit 2b63770 into master Apr 13, 2025
63 checks passed
@jrfnl jrfnl deleted the feature/generic-lower-uppercaseconstants-support-php84-final-props branch April 13, 2025 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment