This repository was archived by the owner on Jan 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Additional sniffs and tests #10
Merged
geerteltink
merged 17 commits into
zendframework:develop
from
michalbundyra:feature/additional-sniffs
Jan 1, 2019
Merged
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2c7f66d
Additional sniffs and tests
michalbundyra ed57e47
Updated ruleset to use WebimpressCodingStandard.PHP.DisallowFqn
michalbundyra 259b985
Added test for correct class name
michalbundyra 795085d
We already have some test for concatenation operator
michalbundyra 7ebfb2a
Override sniff to detect redundant alias
michalbundyra 4a6e0a1
Added tests for spacing around comma
michalbundyra 9bf61ae
Added tests for StringClassReference sniff which changes stings to ::…
michalbundyra ef4ce9b
Use PEAR.Commenting.FunctionComment instead of Squiz
michalbundyra 509b47d
Looks like tokenizer works different way on PHP 7.3 for here/nowdoc
michalbundyra c1572c1
Content of heredoc behaves very weirdly on PHP 7.3
michalbundyra e2889e0
Use PSR-12 sniff for class instantiation parenthesis
michalbundyra f7454b7
Sniff renamed
michalbundyra 391acf0
Added AnonymousClassDeclaration sniff and more tests
michalbundyra c2d224c
Added ScopeIndent sniff and adjust tests to pass with all sniffs
michalbundyra a103efa
Added exclusions - covered by ScopeIndent sniff
michalbundyra a701226
Updated to PHP_CodeSniffer 3.4.0
michalbundyra 31e54f1
Added new sniffs from PHP_CodeSniffer 3.4.0
michalbundyra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
$hereDoc = <<<hereDoc | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
class %s extends %s | ||
{ | ||
} | ||
hereDoc; | ||
|
||
$hereDoc2 = <<< EOT | ||
other... | ||
EOT; | ||
|
||
$nowDoc1 = <<< "now_doc" | ||
some content here | ||
now_doc; | ||
|
||
$nowDoc2 = <<< 'now' | ||
now content! | ||
now; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ | |
->format(DATE_RFC3339) | ||
); | ||
|
||
// new \ Bar \ Baz(); | ||
new \ Bar \ Baz(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace NamingConventions; | ||
|
||
abstract class MyAbstractClass | ||
{ | ||
} | ||
|
||
interface InterfaceHello | ||
{ | ||
} | ||
|
||
trait TraitHello | ||
{ | ||
} | ||
|
||
class InvalidValue extends Exception | ||
{ | ||
} | ||
|
||
class InvalidName extends InvalidArgumentException | ||
{ | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,12 @@ | |
echo Something | ||
:: | ||
BAR; | ||
|
||
if ($a && | ||
$b) { | ||
echo 1; | ||
} | ||
|
||
$a ? | ||
$b : | ||
$c; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,13 @@ | |
for (;;) { | ||
echo 'To infity and beyond'; | ||
}; | ||
|
||
echo 1;; | ||
|
||
$closure = function () { | ||
; | ||
}; | ||
|
||
$anonym = new class() | ||
{ | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,6 @@ | |
. '2' | ||
. '3'; | ||
|
||
$string = '1' . | ||
'2' . | ||
'3'; | ||
$string = '1' | ||
. '2' | ||
. '3'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't these two be aligned with the equal sign?
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?