-
Notifications
You must be signed in to change notification settings - Fork 8
Additional sniffs and tests #10
Additional sniffs and tests #10
Conversation
<!-- Forbid useless semicolon `;` --> | ||
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/> | ||
<!-- Forbid redundant semicolons --> | ||
<rule ref="WebimpressCodingStandard.PHP.RedundantSemicolon"/> |
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.
Any reason for replacing these Slevomat tools with Webimpress ones, besides ownership?
Now rulesets are not confliced and cases with spaces around namespace separator pass correctly.
Sniff from webimpress/coding-standard detects also redundant alias for function traits
test/fixed/concatenation-spacing.php
Outdated
'3'; | ||
$string = '1' | ||
. '2' | ||
. '3'; |
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.
Shouldn't these two be aligned with the equal sign?
$string = '1'
. '2'
. '3';
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.
Maybe it should but we don't have any sniff like that... And what if concatenation is in let say sprintf
:
throw new \Exception(sprintf(
'This is very very very long error message'
. ' with some exception: %s',
$e->getMessage()
));
There is so many cases. ScopeIndent from PHP_CodeSniffer doesn't include so many cases and my is super strict, and controversial in some places ;-) We can try, but ... hah
I think PHP_CodeSniffer needs some adjustments for PHP 7.3
- no spaces around incrementation/decrementation - no spaces after nullable oparator in nullable type declaration
Additional sniffs and tests
Thanx @webimpress |
@xtreamwayz this is the second part I was talking about
We need to add some test for sniffs - I marked them with
@todo
tag.Again, documentation is not updated, I can do it later or feel free to do it :)