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.PHP.LowerCaseConstant and Generic.NamingConventions.UpperCaseConstantName are in conflict? #855

Closed
3 of 4 tasks
tonebender opened this issue Mar 4, 2025 · 1 comment

Comments

@tonebender
Copy link

tonebender commented Mar 4, 2025

Describe the bug

The Squiz ruleset has included BOTH Generic.NamingConventions.UpperCaseConstantName and Generic.PHP.LowerCaseConstant, which contradict each other. The former stipulates that true, false and null constants must always be uppercase, while the latter says that they must always be lowercase.

Which one should be followed, and why are both in the Squiz ruleset?

Code sample

From Squiz/ruleset.xml:

    <rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
    <rule ref="Generic.PHP.LowerCaseConstant"/>

Versions (please complete the following information)

Operating System Debian Linux
PHP version 8.2.24
PHP_CodeSniffer version 3.11.3
Standard Squiz
Install type Composer (local)

Additional context

Add any other context about the problem here.

Please confirm

  • I have searched the issue list and am not opening a duplicate issue.
  • I have read the Contribution Guidelines and this is not a support question.
  • I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
  • I have verified the issue still exists in the master branch of PHP_CodeSniffer.
@jrfnl
Copy link
Member

jrfnl commented Mar 4, 2025

@tonebender Closing as invalid. Generic.NamingConventions.UpperCaseConstantName is about the declaration case for user-defined constants. There is no conflict between these rules.

@jrfnl jrfnl closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants