Skip to content

Commit

Permalink
PHP 8.0 | Squiz/LowercaseDeclaration: add match to keyword list
Browse files Browse the repository at this point in the history
This adds the PHP 8.0 `match` keyword to the list handled by this sniff.

Includes unit test.
  • Loading branch information
jrfnl committed Feb 23, 2021
1 parent 8b0137a commit b2ed117
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function register()
T_WHILE,
T_TRY,
T_CATCH,
T_MATCH,
];

}//end register()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ If ($condition) {
TRY {
} Catch (Exception $e) {
}

$r = MATCH ($x) {};
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ if ($condition) {
try {
} catch (Exception $e) {
}

$r = match ($x) {};
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function getErrorList()
16 => 1,
20 => 1,
21 => 1,
24 => 1,
];

}//end getErrorList()
Expand Down

0 comments on commit b2ed117

Please sign in to comment.