Skip to content

Commit afffe6c

Browse files
committed
Add a test to ensure the sniff is not triggered for the match expression
Adding this as `match` was added in PHP 8.
1 parent 77390f4 commit afffe6c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,8 @@ class NonArbitraryParenthesesWithKeywords {
175175
$d = new parent( $foo,$bar );
176176
}
177177
}
178+
179+
// Test that the match expression does not trigger the sniff.
180+
$b = match ( $a ) {
181+
1 => true,
182+
};

src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc.fixed

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,8 @@ class NonArbitraryParenthesesWithKeywords {
163163
$d = new parent( $foo,$bar );
164164
}
165165
}
166+
167+
// Test that the match expression does not trigger the sniff.
168+
$b = match ( $a ) {
169+
1 => true,
170+
};

0 commit comments

Comments
 (0)