Giter VIP home page Giter VIP logo

Comments (5)

derrabus avatar derrabus commented on July 21, 2024

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.

BackEndTea avatar BackEndTea commented on July 21, 2024

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.

derrabus avatar derrabus commented on July 21, 2024

But how does removing the auto-fixer solve that problem for you?

from coding-standard.

derrabus avatar derrabus commented on July 21, 2024

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.

beberlei avatar beberlei commented on July 21, 2024

You can just disable this rule in your project:

    <rule ref="Doctrine">
        <exclude name="SlevomatCodingStandard.Classes.ClassConstantVisibility" />
   </rule>

from coding-standard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.