Skip to content

Commit

Permalink
PHP 8.0 | Generic/AssignmentInCondition: include match expressions
Browse files Browse the repository at this point in the history
Allows the sniff to also check for assignments in condition in the condition part of a match expression.

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

}//end register()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,5 @@ while ( $sample = false ) {}

if ($a = 123) :
endif;

match ($a[0] = 123) {};
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public function getWarningList()
88 => 1,
90 => 1,
92 => 1,
95 => 1,
];

}//end getWarningList()
Expand Down

0 comments on commit 580e9de

Please sign in to comment.