Skip to content

Commit 6570218

Browse files
committed
AC-1339: Detect comment for typed class properties
1 parent 14704dd commit 6570218

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,9 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
6060

6161
if ($commentEnd !== false && $tokens[$commentEnd]['code'] === T_STRING) {
6262
$commentEnd = $phpcsFile->findPrevious($this->ignoreTokens, ($commentEnd - 1), null, true);
63-
}
64-
65-
if ($commentEnd === false
63+
} else if ($commentEnd === false
6664
|| ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG
67-
&& $tokens[$commentEnd]['code'] !== T_COMMENT
68-
&& $tokens[$commentEnd]['code'] !== T_STRING)
65+
&& $tokens[$commentEnd]['code'] !== T_COMMENT)
6966
) {
7067
$phpcsFile->addWarning('Missing PHP DocBlock for class property.', $stackPtr, 'Missing');
7168
return;

0 commit comments

Comments
 (0)