Skip to content

Commit

Permalink
Fix false-negative when missing semicolon
Browse files Browse the repository at this point in the history
  • Loading branch information
fredden committed Jun 8, 2023
1 parent 33f38f1 commit 01410b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ public function process(File $phpcsFile, $stackPtr)
if ($tokens[$start]['code'] === T_SEMICOLON) {
break;
}

if ($tokens[$start]['code'] === T_CLOSE_TAG) {
break;
}
}//end for

if (isset($tokens[$start]) === false) {
Expand Down

0 comments on commit 01410b4

Please sign in to comment.