Skip to content
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

new standards #144

Open
3 tasks
wickedOne opened this issue Jun 25, 2018 · 3 comments
Open
3 tasks

new standards #144

wickedOne opened this issue Jun 25, 2018 · 3 comments

Comments

@wickedOne
Copy link
Contributor

wickedOne commented Jun 25, 2018

did a quick compare between current sniffs and symfony's current standards and noticed the following new rules (which i'll try to provide a sniff for next weekend):

Structure:

  • Add a use statement for every class that is not part of the global namespace.

Documentation

  • Don't inline PHPDoc blocks, even when they contain just one tag (e.g. don't put /** {@inheritdoc} */ in a single line);
  • When adding a new class or when making significant changes to an existing class, an @author tag with personal contact information may be added, or expanded. Please note it is possible to have the personal contact information updated or removed per request to the doc:core team.

for the last one i think we at most can throw a warning

@mmoll
Copy link
Contributor

mmoll commented Nov 19, 2020

@wickedOne For the first one, could you try the following with slevomat/coding-standard?

    <rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
        <properties>
            <property name="allowFullyQualifiedGlobalClasses" value="true"/>
            <property name="allowFullyQualifiedGlobalConstants" value="true"/>
            <property name="allowFullyQualifiedGlobalFunctions" value="true"/>
            <property name="searchAnnotations" type="boolean" value="true"/>
        </properties>
    </rule>

@wickedOne
Copy link
Contributor Author

i'm not entirely sure what would be the purpose of trying another coding standard within this one;
are you suggesting to copy slevomat's code into this repository?

@mmoll
Copy link
Contributor

mmoll commented Dec 27, 2020

@wickedOne I'd use it as a dependency, see https://github.com/djoos/Symfony-coding-standard/pull/183/files#diff-ab8597c76d04ad91201fc5cb1ea17cad514970360d740fe3d4bf016cdc88e70d for how it would look like to use slevomat sniffs instead of some homegrown ones in this standard.

For testing the snippet above, you'd need to add it to your setup in some way (composer and auto-registration with https://github.com/DealerDirect/phpcodesniffer-composer-installer is what I use in such cases) and add the code in vendor/escapestudios/symfony2-coding-standard/Symfony/ruleset.xml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants