Skip to content

Commit 200052a

Browse files
committed
refactor(SwitchDeclaration): Replace CaseSemicolonSniff with SwitchDeclarationSniff from PHPCS
1 parent 884ede0 commit 200052a

File tree

6 files changed

+11
-111
lines changed

6 files changed

+11
-111
lines changed

coder_sniffer/Drupal/Sniffs/ControlStructures/CaseSemicolonSniff.php

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

coder_sniffer/Drupal/ruleset.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@
114114
<!-- Already covered by Drupal.Classes.PropertyDeclaration.VarUsed. -->
115115
<exclude name="PSR2.Classes.PropertyDeclaration.VarUsed"/>
116116
</rule>
117+
<rule ref="PSR2.ControlStructures.SwitchDeclaration">
118+
<!-- Disable some error messages that we do not want. -->
119+
<exclude name="PSR2.ControlStructures.SwitchDeclaration.BodyOnNextLineCASE"/>
120+
<exclude name="PSR2.ControlStructures.SwitchDeclaration.BreakIndent"/>
121+
</rule>
117122
<rule ref="PSR2.Methods.MethodDeclaration"/>
118123
<rule ref="PSR2.Namespaces.NamespaceDeclaration"/>
119124
<rule ref="PSR2.Namespaces.UseDeclaration"/>

tests/Drupal/ControlStructures/CaseSemicolonUnitTest.php

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

tests/Drupal/bad/BadUnitTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ protected function getErrorList(string $testFile): array
367367
872 => 1,
368368
876 => 2,
369369
];
370+
case 'CaseSemicolonUnitTest.inc':
371+
return [
372+
1 => 1,
373+
13 => 1,
374+
17 => 1,
375+
];
370376
case 'ClassCreateInstanceUnitTest.inc':
371377
return [
372378
3 => 1,

0 commit comments

Comments
 (0)