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

Traits in inline classes #616

Open
martin-pettersson opened this issue Dec 28, 2022 · 1 comment
Open

Traits in inline classes #616

martin-pettersson opened this issue Dec 28, 2022 · 1 comment

Comments

@martin-pettersson
Copy link

Q A
Bug report? yes
Feature request? no
Library version 2.6.1

Using traits in inline classes causes two false positives:

  • SlevomatCodingStandard\Sniffs\Namespaces\UseSpacingSniff
    • Will report an error since there is spacing between the use of the trait and the "import" use list.
  • SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff
    • May report an error if the trait is NOT the last item in the "import" use list.
use A\SomeTrait;
use B\SomeOtherImport;

(new class() { use SomeTrait; })->someMethod();
@martin-pettersson
Copy link
Author

I created this issue so as not to forget about it but perhaps this should be filed under Slevomat Coding Standard instead?

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

1 participant