Skip to content

Commit 579f081

Browse files
rodrigoprimojrfnl
authored andcommitted
Squiz/ClosingDeclarationComment: remove unreachable condition
This commit removes an if condition that cannot be true. The `$closingBracket` variable can never be null as the sniff already bows out before setting the variable when checking if `isset($tokens[$stackPtr]['scope_closer']) === false`.
1 parent 7443644 commit 579f081

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ public function process(File $phpcsFile, $stackPtr)
8585

8686
$closingBracket = $tokens[$stackPtr]['scope_closer'];
8787

88-
if ($closingBracket === null) {
89-
// Possible inline structure. Other tests will handle it.
90-
return;
91-
}
92-
9388
$data = [$comment];
9489
if (isset($tokens[($closingBracket + 1)]) === false || $tokens[($closingBracket + 1)]['code'] !== T_COMMENT) {
9590
$next = $phpcsFile->findNext(T_WHITESPACE, ($closingBracket + 1), null, true);

0 commit comments

Comments
 (0)