Skip to content

Commit

Permalink
Squiz.PHP.DisallowMultipleAssignmentsSniff: Fixed false positive when…
Browse files Browse the repository at this point in the history
… assigment is after goto label
  • Loading branch information
kukulich committed Apr 8, 2021
1 parent c19a0f5 commit 557756c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public function process(File $phpcsFile, $stackPtr)

if ($tokens[$varToken]['code'] === T_VARIABLE
|| $tokens[$varToken]['code'] === T_OPEN_TAG
|| $tokens[$varToken]['code'] === T_GOTO_LABEL
|| $tokens[$varToken]['code'] === T_INLINE_THEN
|| $tokens[$varToken]['code'] === T_INLINE_ELSE
|| $tokens[$varToken]['code'] === T_SEMICOLON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,13 @@ function ($html) {
return $all;
}, $html);
};


function () {
$a = false;

some_label:

$b = getB();
};

0 comments on commit 557756c

Please sign in to comment.