From 33845b80de9b9e9cd45fe66fb17c6b18bb9509c7 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 11 Aug 2023 02:17:40 +0200 Subject: [PATCH] PSR2/PSR12/ControlStructureSpacing: don't listen for `T_ELSE` No functional changes. These sniffs only concerns themselves with control structures which take parentheses, so listening for `T_ELSE` is unnecessary as the sniffs will never do anything for that token (they each bow out on no 'parenthesis_opener'/'parenthesis_closer' found). --- .../Sniffs/ControlStructures/ControlStructureSpacingSniff.php | 1 - .../Sniffs/ControlStructures/ControlStructureSpacingSniff.php | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php b/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php index 3d29c4ace1..0455e2e25e 100644 --- a/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php +++ b/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php @@ -38,7 +38,6 @@ public function register() T_FOREACH, T_FOR, T_SWITCH, - T_ELSE, T_ELSEIF, T_CATCH, T_MATCH, diff --git a/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php b/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php index 09d2c14a07..00e7479394 100644 --- a/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php +++ b/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php @@ -44,7 +44,6 @@ public function register() T_FOREACH, T_FOR, T_SWITCH, - T_ELSE, T_ELSEIF, T_CATCH, T_MATCH,