File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -57,13 +57,20 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
57
57
$ tokens = $ phpcsFile ->getTokens ();
58
58
59
59
$ commentEnd = $ phpcsFile ->findPrevious ($ this ->ignoreTokens , ($ stackPtr - 1 ), null , true );
60
+
61
+ if ($ commentEnd !== false && $ tokens [$ commentEnd ]['code ' ] === T_STRING ) {
62
+ $ commentEnd = $ phpcsFile ->findPrevious ($ this ->ignoreTokens , ($ commentEnd - 1 ), null , true );
63
+ }
64
+
60
65
if ($ commentEnd === false
61
66
|| ($ tokens [$ commentEnd ]['code ' ] !== T_DOC_COMMENT_CLOSE_TAG
62
- && $ tokens [$ commentEnd ]['code ' ] !== T_COMMENT )
67
+ && $ tokens [$ commentEnd ]['code ' ] !== T_COMMENT
68
+ && $ tokens [$ commentEnd ]['code ' ] !== T_STRING )
63
69
) {
64
70
$ phpcsFile ->addWarning ('Missing PHP DocBlock for class property. ' , $ stackPtr , 'Missing ' );
65
71
return ;
66
72
}
73
+
67
74
$ commentStart = $ tokens [$ commentEnd ]['comment_opener ' ];
68
75
$ foundVar = null ;
69
76
foreach ($ tokens [$ commentStart ]['comment_tags ' ] as $ tag ) {
Original file line number Diff line number Diff line change @@ -120,4 +120,10 @@ class correctlyFormattedClassMemberDocBlock
120
120
* @var test
121
121
*/
122
122
protected $ test ;
123
+
124
+ /**
125
+ * @var string
126
+ */
127
+ protected string $ test ;
128
+
123
129
}
You can’t perform that action at this time.
0 commit comments