diff --git a/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php b/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php index 63e831949e..8788a912ea 100644 --- a/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php +++ b/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php @@ -60,6 +60,7 @@ public function register() T_SWITCH, T_CASE, T_WHILE, + T_MATCH, ]; }//end register() diff --git a/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.inc b/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.inc index 49c6cfa77e..9560abbbb1 100644 --- a/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.inc +++ b/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.inc @@ -91,3 +91,5 @@ while ( $sample = false ) {} if ($a = 123) : endif; + +match ($a[0] = 123) {}; diff --git a/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.php b/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.php index e489f1c35e..3ed57d2207 100644 --- a/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.php +++ b/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.php @@ -74,6 +74,7 @@ public function getWarningList() 88 => 1, 90 => 1, 92 => 1, + 95 => 1, ]; }//end getWarningList()