Skip to content

Commit d23d5ae

Browse files
committed
Generic/EmptyPHPStatement: remove unreachable condition
`$prevNonEmpty` will never be `false` as there will always be at least a PHP open tag token before the semicolon token.
1 parent 15db723 commit d23d5ae

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ public function process(File $phpcsFile, $stackPtr)
5353
case 'T_SEMICOLON':
5454
$prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true);
5555

56-
if ($prevNonEmpty === false) {
57-
return;
58-
}
59-
6056
if ($tokens[$prevNonEmpty]['code'] !== T_SEMICOLON
6157
&& $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG
6258
&& $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG_WITH_ECHO

0 commit comments

Comments
 (0)