-
Notifications
You must be signed in to change notification settings - Fork 40
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
Sniff idea: Detect when constant is being used in constant() #717
Comments
Hmm... while I understand where you are coming from, I don't think this is a good idea. When I - as a dev - look at the above code samples, I would say that:
|
Agreed. But in instances like our vip-go-mu-plugins, sometimes we have to call |
@rebeccahum Just had a look, but in those cases, you are not calling the PHP native global |
Describe the solution you'd like
Not sure if VIPCS is the best way forward, but I think this would be a worthy sniff.
When using
constant()
, we should throw a warning if a string is not being inputted. Of course it is valid PHP to do something like:But I think most likely, what the user wants to do is:
What code should be reported as a violation?
What code should not be reported as a violation?
The text was updated successfully, but these errors were encountered: