Skip to content

Commit ddd57bf

Browse files
authored
refactor(MethodDeclaration): Use upstream sniff (#3556854)
1 parent 5b3d4e1 commit ddd57bf

File tree

4 files changed

+4
-47
lines changed

4 files changed

+4
-47
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,5 @@ jobs:
9797
sed -i '/<rule ref="Drupal.Functions.FunctionDeclaration"\/>/d' phpcs.xml.dist
9898
sed -i 's/DrupalPractice.CodeAnalysis.VariableAnalysis/VariableAnalysis.CodeAnalysis.VariableAnalysis/g' phpcs.xml.dist
9999
find .. -type f -name "*.php" -exec sed -i 's#// phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis#// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis#g' {} +
100+
sed -i 's/Drupal.Methods.MethodDeclaration/PSR2.Methods.MethodDeclaration/g' phpcs.xml.dist
100101
../../vendor/bin/phpcs -p -s --parallel=$(nproc) --ignore=lib/Drupal/Core/Command/GenerateTheme.php,modules/mysql/tests/src/Kernel/mysql/Console/DbDumpCommandTest.php,modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php,tests/fixtures/plugins/CustomPlugin.php,modules/package_manager/tests/modules/package_manager_test_api/src/ApiController.php

coder_sniffer/Drupal/Sniffs/Methods/MethodDeclarationSniff.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

coder_sniffer/Drupal/ruleset.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@
2222
<!-- Do not run this sniff on template files. -->
2323
<exclude-pattern>*.tpl.php</exclude-pattern>
2424
</rule>
25-
26-
<!-- Silence method name underscore warning which is covered already in
27-
Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps. -->
28-
<rule ref="Drupal.Methods.MethodDeclaration.Underscore">
29-
<severity>0</severity>
30-
</rule>
31-
3225
<rule ref="Drupal.WhiteSpace.CloseBracketSpacing">
3326
<!-- Do not run this sniff on template files. -->
3427
<exclude-pattern>*.tpl.php</exclude-pattern>
@@ -119,6 +112,7 @@
119112
<!-- Already covered by Drupal.Classes.PropertyDeclaration.VarUsed. -->
120113
<exclude name="PSR2.Classes.PropertyDeclaration.VarUsed"/>
121114
</rule>
115+
<rule ref="PSR2.Methods.MethodDeclaration"/>
122116
<rule ref="PSR2.Namespaces.NamespaceDeclaration"/>
123117
<rule ref="PSR2.Namespaces.UseDeclaration"/>
124118

tests/Drupal/bad/BadUnitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ protected function getWarningList(string $testFile): array
446446
363 => 1,
447447
366 => 1,
448448
382 => 1,
449+
407 => 1,
450+
411 => 1,
449451
433 => 1,
450452
434 => 1,
451453
436 => 1,

0 commit comments

Comments
 (0)