Skip to content

Commit 3db1049

Browse files
committed
Generic/InlineControlStructure: stop listening for T_SWITCH tokens
There is no inline version of a `switch` in PHP so there is no reason for this sniff to listen to `T_SWITCH` tokens. Before this change, the sniff would bail early on the line below as a switch always has a scope opener, so this change should not impact in any way the behavior of the sniff. https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/9a0c2546ea2fa7aac19881da7b655cc5f022bc10/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php#L71 The InlineControlStructure sniff started listening for T_SWITCH tokens since the commit that added this sniff to PHPCS: ad96ebb#diff-e1ea4eabd79d6324057bbf726a27074250478f87d92c11a3725a97f0afbd5513R50
1 parent daa1940 commit 3db1049

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public function register()
4848
T_FOREACH,
4949
T_WHILE,
5050
T_DO,
51-
T_SWITCH,
5251
T_FOR,
5352
];
5453

0 commit comments

Comments
 (0)