Skip to content

Improve message for sniff for constants (rule 107) #163

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

Closed
krisdante opened this issue Dec 14, 2019 · 2 comments
Closed

Improve message for sniff for constants (rule 107) #163

krisdante opened this issue Dec 14, 2019 · 2 comments
Labels
enhancement Improvements to existing rules

Comments

@krisdante
Copy link

Description

#107 message says:

Constants must have short description if they add information beyond what the constant name supplies.

This is missleading message as this warning is shown for all the constants. Even obvious ones as NUMBER_PI=3.14.

Expected behavior

The message shall say:
Constants must have short description

Benefits

Less missleading

@krisdante krisdante added the enhancement Improvements to existing rules label Dec 14, 2019
@krisdante krisdante changed the title Improve message for rule #107 Improve message for sniff for constants Dec 14, 2019
@krisdante krisdante changed the title Improve message for sniff for constants Improve message for sniff for constants (rule 107) Dec 14, 2019
@lenaorobei
Copy link
Contributor

Hi @krisdante. Could you please share the whole code snipped including PHP DocBlock?
Let me share the expected behavior of this rule.

Not OK (Description duplicates the name):

/**
 * Nesting separator.
 */
const NESTING_SEPARATOR = '->';

OK (no description):

const NESTING_SEPARATOR = '->';

OK (meaningful description):

/**
 * Some additional description beyond what the constant name supplies.
 */
const NESTING_SEPARATOR = '->';

@krisdante
Copy link
Author

Yes, you are right. I got confused by the message.

magento-devops-reposync-svc pushed a commit that referenced this issue Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing rules
Projects
None yet
Development

No branches or pull requests

2 participants