Skip to content

Commit

Permalink
Add two SlevomatCodingStandard.Functions sniffs
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoll committed Apr 22, 2021
1 parent 36e90fb commit a779121
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions MO4/Sniffs/Commenting/PropertyCommentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function __construct()
* listening to.
*
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter
*
* @param File $phpcsFile The file where this token was found.
* @param int $stackPtr The position in the stack where this
Expand Down Expand Up @@ -241,6 +242,7 @@ protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScop
* Process tokens outside scope.
*
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter
*
* @param File $phpcsFile The file where this token was found.
* @param int $stackPtr The position in the stack where this
Expand Down
4 changes: 1 addition & 3 deletions MO4/Tests/Formatting/UnnecessaryNamespaceUsageUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ class UnnecessaryNamespaceUsageUnitTest extends AbstractSniffUnitTest
* The key of the array should represent the line number and the value
* should represent the number of errors that should occur on that line.
*
* @param string $testFile test file
*
* @return array<int, int>
*/
protected function getErrorList(string $testFile = ''): array
protected function getErrorList(): array
{
return [];
}
Expand Down
8 changes: 6 additions & 2 deletions MO4/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,14 @@
<property name="ignoreMultiline" value="true"/>
</properties>
</rule>
<!-- Require global functions to be referenced via a fully qualified name -->
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>
<!-- Require static closures for microoptimization -->
<rule ref="SlevomatCodingStandard.Functions.StaticClosure"/>
<!-- Forbid unused function parameters -->
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter"/>
<!-- Forbids useless parameter default values -->
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue"/>
<!-- Require global functions to be referenced via a fully qualified name -->
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>
<!-- Forbid multiple use statements on same line -->
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>
<!-- Require one newline around namespace declaration -->
Expand Down

0 comments on commit a779121

Please sign in to comment.