File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -57,13 +57,17 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
5757 $ tokens = $ phpcsFile ->getTokens ();
5858
5959 $ commentEnd = $ phpcsFile ->findPrevious ($ this ->ignoreTokens , ($ stackPtr - 1 ), null , true );
60- if ($ commentEnd === false
60+
61+ if ($ commentEnd !== false && $ tokens [$ commentEnd ]['code ' ] === T_STRING ) {
62+ $ commentEnd = $ phpcsFile ->findPrevious ($ this ->ignoreTokens , ($ commentEnd - 1 ), null , true );
63+ } elseif ($ commentEnd === false
6164 || ($ tokens [$ commentEnd ]['code ' ] !== T_DOC_COMMENT_CLOSE_TAG
6265 && $ tokens [$ commentEnd ]['code ' ] !== T_COMMENT )
6366 ) {
6467 $ phpcsFile ->addWarning ('Missing PHP DocBlock for class property. ' , $ stackPtr , 'Missing ' );
6568 return ;
6669 }
70+
6771 $ commentStart = $ tokens [$ commentEnd ]['comment_opener ' ];
6872 $ foundVar = null ;
6973 foreach ($ tokens [$ commentStart ]['comment_tags ' ] as $ tag ) {
Original file line number Diff line number Diff line change @@ -120,4 +120,9 @@ class correctlyFormattedClassMemberDocBlock
120120 * @var test
121121 */
122122 protected $ test ;
123+
124+ /**
125+ * @var string
126+ */
127+ protected string $ test ;
123128}
You can’t perform that action at this time.
0 commit comments