Skip to content

Commit 718f390

Browse files
committed
PHP 8.1: Squiz/ControlStructureSpacing - Enums should be ignored
1 parent a34b500 commit 718f390

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ public function process(File $phpcsFile, $stackPtr)
145145
T_CLASS => true,
146146
T_INTERFACE => true,
147147
T_TRAIT => true,
148+
T_ENUM => true,
148149
T_DOC_COMMENT_OPEN_TAG => true,
149150
];
150151

src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,7 @@ $expr = match( $foo ){
261261

262262
};
263263
echo $expr;
264+
265+
enum SomeEnum
266+
{
267+
}

src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,7 @@ $expr = match($foo){
253253
};
254254

255255
echo $expr;
256+
257+
enum SomeEnum
258+
{
259+
}

0 commit comments

Comments
 (0)