@@ -59,15 +59,15 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
59
59
|| ($ tokens [$ commentEnd ]['code ' ] !== T_DOC_COMMENT_CLOSE_TAG
60
60
&& $ tokens [$ commentEnd ]['code ' ] !== T_COMMENT )
61
61
) {
62
- $ phpcsFile ->addWarning ('Missing class property doc comment ' , $ stackPtr , 'Missing ' );
62
+ $ phpcsFile ->addWarning ('Missing PHP DocBlock for class property. ' , $ stackPtr , 'Missing ' );
63
63
return ;
64
64
}
65
65
$ commentStart = $ tokens [$ commentEnd ]['comment_opener ' ];
66
66
$ foundVar = null ;
67
67
foreach ($ tokens [$ commentStart ]['comment_tags ' ] as $ tag ) {
68
68
if ($ tokens [$ tag ]['content ' ] === '@var ' ) {
69
69
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. ' ;
71
71
$ phpcsFile ->addWarning ($ error , $ tag , 'DuplicateVar ' );
72
72
} else {
73
73
$ foundVar = $ tag ;
@@ -76,22 +76,22 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
76
76
}
77
77
78
78
if ($ foundVar === null ) {
79
- $ error = 'Missing @var tag in class property comment ' ;
79
+ $ error = 'Class properties must have type declaration using @var tag. ' ;
80
80
$ phpcsFile ->addWarning ($ error , $ stackPtr , 'MissingVar ' );
81
81
return ;
82
82
}
83
83
84
84
$ string = $ phpcsFile ->findNext (T_DOC_COMMENT_STRING , $ foundVar , $ commentEnd );
85
85
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. ' ;
87
87
$ phpcsFile ->addWarning ($ error , $ foundVar , 'EmptyVar ' );
88
88
return ;
89
89
}
90
90
91
91
// Check if class has already have meaningful description
92
92
$ isShortDescription = $ phpcsFile ->findPrevious (T_DOC_COMMENT_STRING , $ commentEnd , $ foundVar , false );
93
93
if ($ this ->PHPDocFormattingValidator ->providesMeaning ($ isShortDescription , $ commentStart , $ tokens ) !== true ) {
94
- $ error = 'Variable member already have meaningful name ' ;
94
+ $ error = 'Short description duplicates class property name. ' ;
95
95
$ phpcsFile ->addWarning ($ error , $ isShortDescription , 'AlreadyHaveMeaningFulNameVar ' );
96
96
return ;
97
97
}
0 commit comments