-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Constant visibility false positive on non-class constants #2615
Comments
Confirmed. This is a bug. |
What Is the resolution on this going to look like? I have a project that is advertised as supporting php 7.0+. Class constants just started being flagged with this today on Travis-ci. Since visibility on constants didn’t appear until 7.1, do I need to turn this check off in my coding standards file? |
For completeness, the sniff is |
Thanks for reporting this. Fix will be in 3.5.1, which will be released when I've fixed the other PSR-12 issues that have come through. Check out the milestone for the list. |
Not really fixed. It is also in: PHP_CodeSniffer version 3.5.8 (stable) by Squiz (http://www.squiz.net) with PHPStorm. I am using PSR-12 EDIT: This is a class constant. |
@vaso123 I think you misunderstand the earlier reported issue. Constant visibility was previously - incorrectly - demanded for non-class constants. That bug has been fixed and can no longer be reproduced. I suspect you don't want to use class constant visibility as your project needs to support older PHP versions. Is that correct ? |
Ok, got it, you are right, sorry. |
But the code is
so a normal classless file, as such visibility for such a const cannot be given, can it?
The text was updated successfully, but these errors were encountered: