Skip to content

Commit 2c95041

Browse files
committed
Merge branch 'php-8.0/pear-controlsignature-support-match' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents 8823890 + f8fd8ae commit 2c95041

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ protected function getPatterns()
3939
'} elseif (...) {EOL',
4040
'} else {EOL',
4141
'do {EOL',
42+
'match (...) {EOL',
4243
];
4344

4445
}//end getPatterns()

src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.inc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,10 @@ if ($i == 0) {
156156
}
157157
else {
158158
}
159-
?>
159+
160+
// match
161+
$r = match ($x) {
162+
1 => 1,
163+
};
164+
165+
$r = match( $x ){ 1 => 1 };

src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function getErrorList()
4848
133 => 2,
4949
147 => 1,
5050
157 => 1,
51+
165 => 1,
5152
];
5253

5354
}//end getErrorList()

0 commit comments

Comments
 (0)