-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add more new sniffs #11
Conversation
<!-- Require EOL at EOF --> | ||
<rule ref="Generic.Files.EndFileNewline"/> | ||
<!-- Forbid multiple classes per file --> | ||
<rule ref="Generic.Files.OneClassPerFile"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one will be problematic for ORM where tests have their entities defined in the same file. Could be excluded on project level though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be excluded per-directory IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that is possible to configure, even better. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would simply require a custom local phpcs.xml
file per directory to be inspected, with overrides for disabled rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this covered by PSR1.Classes.ClassDeclaration.MultipleClasses
(which is part of PSR-2)? If so, we already exclude things in the ORM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't realize it's already included 👍, we can remove these checks then, PSR-1 sniff provides check for classes/interfaces/traits at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in 2ac121d.
3a5a3d8
to
4d1f300
Compare
4d1f300
to
c8f1e66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Second part of new sniffs, this time not 7.1-related, but more generic instead. Comments for each sniff are in the ruleset.
Most of these should already be ok on 99% of code base and are mostly to maintain consistence.
Also removed sniffs for spaces around
!
, replaced by generic sniff for spaces after!
(as agreed in past and suggested in #9).cc @alcaeus @lcobucci