Comments (5)
Since the auto fixer for this rule sets the visibility to public, this may cause constants to get more visibility then really needed.
No, constants without a visibility modifier have always been public. The auto-fixer is correct.
from coding-standard.
No, constants without a visibility modifier have always been public. The auto-fixer is correct.
True, they were public before. My problem is that some times these constants should have been private or protected.
from coding-standard.
But how does removing the auto-fixer solve that problem for you?
from coding-standard.
I'd like to close this issue as "won't fix".
On PHP versions that support visibility modifiers for constants, it is reasonable to enforce them. The current fixer implements the safest way forward. On classes where you don't want the fixer to be executed, you can ignore the corresponding sniff. If we just deactivted the fixer while keeping the sniff, you would need to do that anyway.
from coding-standard.
You can just disable this rule in your project:
<rule ref="Doctrine">
<exclude name="SlevomatCodingStandard.Classes.ClassConstantVisibility" />
</rule>
from coding-standard.
Related Issues (20)
- Use stable release of slevomat/coding-standard HOT 4
- PSR-12 integration HOT 2
- A phpDoc template closing tag is mistakenly considered belonging to the following function
- False positive using intersection types in type annotation HOT 4
- Add SlevomatCodingStandard.Functions.StrictCall HOT 3
- Forbid more functions
- The php72 test-report job is always successful HOT 5
- doctrine/coding-standard 8.0.0 requires dealerdirect/phpcodesniffer-composer-installer ^0.6.2 HOT 1
- phpcs: ERROR: Referenced sniff "SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace" does not exist HOT 1
- duplicate rules for visibility of class constants
- class and properties with no spaces between them seem to be allowed
- Ignore some case for EarlyExit rule HOT 1
- suggestion: a good readme HOT 2
- Support for PHPCS ^4.0 HOT 2
- Reconsider enforcement of union types over the nullable ones HOT 6
- Add WordpressArray sniff HOT 4
- New version HOT 5
- Duplicate `RequireOneLineDocComment` in ruleset HOT 1
- Switch to phpcsstandards/codesniffer HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coding-standard.