Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests(phpstan): Add PHPStan to detect problems in sniff code (#3104477)
- Loading branch information
Showing
6 changed files
with
34 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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,28 @@ | ||
parameters: | ||
level: 0 | ||
paths: | ||
- coder_sniffer/Drupal/Sniffs | ||
autoload_files: | ||
- coder_sniffer/Drupal/Test/phpunit-bootstrap.php | ||
ignoreErrors: | ||
# Already fixed in PHP_CodeSniffer, remove once 3.5.4 is released. | ||
- | ||
count: 3 | ||
message: '~^Cannot unset offset~' | ||
path: %currentWorkingDirectory%/coder_sniffer/Drupal/Sniffs/Formatting/MultipleStatementAlignmentSniff.php | ||
# PHPStan does not support variable variables, see https://github.com/phpstan/phpstan/issues/2810 | ||
- | ||
count: 3 | ||
message: '~^Undefined variable: \$value[123]$~' | ||
path: %currentWorkingDirectory%/coder_sniffer/Drupal/Sniffs/InfoFiles/ClassFilesSniff.php | ||
- | ||
count: 3 | ||
message: '~^Undefined variable: \$value[123]$~' | ||
path: %currentWorkingDirectory%/coder_sniffer/Drupal/Sniffs/InfoFiles/DuplicateEntrySniff.php | ||
# We don't want to introduce abstract methods for the 2 calls because | ||
# the class is used in different ways where those methods are not | ||
# always necessary for implementors. | ||
- | ||
count: 2 | ||
message: '~^Call to an undefined method Drupal\\Sniffs\\Semantics\\FunctionCall::(registerFunctionNames|processFunctionCall)\(\).$~' | ||
path: %currentWorkingDirectory%/coder_sniffer/Drupal/Sniffs/Semantics/FunctionCall.php |