Skip to content

Commit 17e993b

Browse files
Feedback suggestions
1 parent 785f0c3 commit 17e993b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
5959
|| ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG
6060
&& $tokens[$commentEnd]['code'] !== T_COMMENT)
6161
) {
62-
$phpcsFile->addWarning('Missing class property doc comment', $stackPtr, 'Missing');
62+
$phpcsFile->addWarning('Missing PHP DocBlock for class property.', $stackPtr, 'Missing');
6363
return;
6464
}
6565
$commentStart = $tokens[$commentEnd]['comment_opener'];
6666
$foundVar = null;
6767
foreach ($tokens[$commentStart]['comment_tags'] as $tag) {
6868
if ($tokens[$tag]['content'] === '@var') {
6969
if ($foundVar !== null) {
70-
$error = 'Only one @var tag is allowed in a class property comment';
70+
$error = 'Only one @var tag is allowed for class property declaration.';
7171
$phpcsFile->addWarning($error, $tag, 'DuplicateVar');
7272
} else {
7373
$foundVar = $tag;
@@ -76,22 +76,22 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
7676
}
7777

7878
if ($foundVar === null) {
79-
$error = 'Missing @var tag in class property comment';
79+
$error = 'Class properties must have type declaration using @var tag.';
8080
$phpcsFile->addWarning($error, $stackPtr, 'MissingVar');
8181
return;
8282
}
8383

8484
$string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $foundVar, $commentEnd);
8585
if ($string === false || $tokens[$string]['line'] !== $tokens[$foundVar]['line']) {
86-
$error = 'Content missing for @var tag in class property comment';
86+
$error = 'Content missing for @var tag in class property declaration.';
8787
$phpcsFile->addWarning($error, $foundVar, 'EmptyVar');
8888
return;
8989
}
9090

9191
// Check if class has already have meaningful description
9292
$isShortDescription = $phpcsFile->findPrevious(T_DOC_COMMENT_STRING, $commentEnd, $foundVar, false);
9393
if ($this->PHPDocFormattingValidator->providesMeaning($isShortDescription, $commentStart, $tokens) !== true) {
94-
$error = 'Variable member already have meaningful name';
94+
$error = 'Short description duplicates class property name.';
9595
$phpcsFile->addWarning($error, $isShortDescription, 'AlreadyHaveMeaningFulNameVar');
9696
return;
9797
}

0 commit comments

Comments
 (0)