File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,6 @@ public function process(File $phpcsFile, $stackPtr)
7878 $ ignore = (Tokens::$ methodPrefixes + Tokens::$ phpcsCommentTokens );
7979 $ ignore [T_WHITESPACE ] = T_WHITESPACE ;
8080 $ functionCodeStart = $ stackPtr ;
81- $ phpstanCommentLines = 0 ;
8281
8382 for ($ commentEnd = ($ stackPtr - 1 ); $ commentEnd >= 0 ; $ commentEnd --) {
8483 if (isset ($ ignore [$ tokens [$ commentEnd ]['code ' ]]) === true ) {
@@ -101,7 +100,7 @@ public function process(File $phpcsFile, $stackPtr)
101100 if ($ tokens [$ commentEnd ]['code ' ] === T_COMMENT
102101 && preg_match ('/\@phpstan-ignore/ ' , $ tokens [$ commentEnd ]['content ' ]) === 1
103102 ) {
104- $ phpstanCommentLines += 1 ;
103+ $ functionCodeStart = $ commentEnd ;
105104 continue ;
106105 }
107106
@@ -176,7 +175,7 @@ public function process(File $phpcsFile, $stackPtr)
176175 }
177176 }//end foreach
178177
179- if ($ tokens [$ commentEnd ]['line ' ] !== ($ tokens [$ functionCodeStart ]['line ' ] - 1 - $ phpstanCommentLines )) {
178+ if ($ tokens [$ commentEnd ]['line ' ] !== ($ tokens [$ functionCodeStart ]['line ' ] - 1 )) {
180179 $ error = 'There must be no blank lines after the function comment ' ;
181180 $ fix = $ phpcsFile ->addFixableError ($ error , $ commentEnd , 'SpacingAfter ' );
182181 if ($ fix === true ) {
You can’t perform that action at this time.
0 commit comments