Skip to content

Commit 426c4fc

Browse files
committed
Squiz/VariableComment: remove redundant conditions
`$commentEnd` is retrieved by walking backwards (since the sniffs allows for attributes), so will never be `false`
1 parent c871396 commit 426c4fc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
6868
break;
6969
}
7070

71-
if ($commentEnd === false
72-
|| ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG
73-
&& $tokens[$commentEnd]['code'] !== T_COMMENT)
71+
if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG
72+
&& $tokens[$commentEnd]['code'] !== T_COMMENT
7473
) {
7574
$phpcsFile->addError('Missing member variable doc comment', $stackPtr, 'Missing');
7675
return;

0 commit comments

Comments
 (0)