Skip to content

Commit a779121

Browse files
committed
Add two SlevomatCodingStandard.Functions sniffs
1 parent 36e90fb commit a779121

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

MO4/Sniffs/Commenting/PropertyCommentSniff.php

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function __construct()
6969
* listening to.
7070
*
7171
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint
72+
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter
7273
*
7374
* @param File $phpcsFile The file where this token was found.
7475
* @param int $stackPtr The position in the stack where this
@@ -241,6 +242,7 @@ protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScop
241242
* Process tokens outside scope.
242243
*
243244
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint
245+
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter
244246
*
245247
* @param File $phpcsFile The file where this token was found.
246248
* @param int $stackPtr The position in the stack where this

MO4/Tests/Formatting/UnnecessaryNamespaceUsageUnitTest.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,9 @@ class UnnecessaryNamespaceUsageUnitTest extends AbstractSniffUnitTest
4141
* The key of the array should represent the line number and the value
4242
* should represent the number of errors that should occur on that line.
4343
*
44-
* @param string $testFile test file
45-
*
4644
* @return array<int, int>
4745
*/
48-
protected function getErrorList(string $testFile = ''): array
46+
protected function getErrorList(): array
4947
{
5048
return [];
5149
}

MO4/ruleset.xml

+6-2
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,14 @@
136136
<property name="ignoreMultiline" value="true"/>
137137
</properties>
138138
</rule>
139-
<!-- Require global functions to be referenced via a fully qualified name -->
140-
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>
141139
<!-- Require static closures for microoptimization -->
142140
<rule ref="SlevomatCodingStandard.Functions.StaticClosure"/>
141+
<!-- Forbid unused function parameters -->
142+
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter"/>
143+
<!-- Forbids useless parameter default values -->
144+
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue"/>
145+
<!-- Require global functions to be referenced via a fully qualified name -->
146+
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>
143147
<!-- Forbid multiple use statements on same line -->
144148
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>
145149
<!-- Require one newline around namespace declaration -->

0 commit comments

Comments
 (0)