Skip to content

Commit b2ed117

Browse files
committed
PHP 8.0 | Squiz/LowercaseDeclaration: add match to keyword list
This adds the PHP 8.0 `match` keyword to the list handled by this sniff. Includes unit test.
1 parent 8b0137a commit b2ed117

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function register()
3434
T_WHILE,
3535
T_TRY,
3636
T_CATCH,
37+
T_MATCH,
3738
];
3839

3940
}//end register()

src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ If ($condition) {
2020
TRY {
2121
} Catch (Exception $e) {
2222
}
23+
24+
$r = MATCH ($x) {};

src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc.fixed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ if ($condition) {
2020
try {
2121
} catch (Exception $e) {
2222
}
23+
24+
$r = match ($x) {};

src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function getErrorList()
3737
16 => 1,
3838
20 => 1,
3939
21 => 1,
40+
24 => 1,
4041
];
4142

4243
}//end getErrorList()

0 commit comments

Comments
 (0)