Skip to content

Commit 15a0b4e

Browse files
jrfnlkukulich
authored andcommitted
Squiz/ControlStructureSpacing: fix the enum test
The test as-it-was, wasn't actually testing anything. As the sniff is about control structures, the `enum` needs to be nested in one before the test would fail without the fix,
1 parent 5629985 commit 15a0b4e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ $expr = match( $foo ){
262262
};
263263
echo $expr;
264264

265-
enum SomeEnum
266-
{
265+
if($true) {
266+
267+
enum SomeEnum {}
268+
267269
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ $expr = match($foo){
254254

255255
echo $expr;
256256

257-
enum SomeEnum
258-
{
257+
if($true) {
258+
259+
enum SomeEnum {}
260+
259261
}

0 commit comments

Comments
 (0)