Skip to content

Commit 9d82616

Browse files
committed
Merge branch 'php-8.0/squiz-poststatementcomment-support-match' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents fed6752 + c222fae commit 9d82616

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class PostStatementCommentSniff implements Sniff
4040
T_WHILE => true,
4141
T_FOR => true,
4242
T_FOREACH => true,
43+
T_MATCH => true,
4344
];
4445

4546

src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,9 @@ for (
4646
if ( $condition === true // comment
4747
&& $anotherCondition === false
4848
) {}
49+
50+
$match = match($foo // comment
51+
&& $bar
52+
) {
53+
1 => 1, // comment
54+
};

src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,10 @@ for (
5050
if ( $condition === true // comment
5151
&& $anotherCondition === false
5252
) {}
53+
54+
$match = match($foo // comment
55+
&& $bar
56+
) {
57+
1 => 1,
58+
// comment
59+
};

src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function getErrorList($testFile='PostStatementCommentUnitTest.inc')
3434
10 => 1,
3535
18 => 1,
3636
35 => 1,
37+
53 => 1,
3738
];
3839

3940
case 'PostStatementCommentUnitTest.1.js':

0 commit comments

Comments
 (0)