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)
78
78
$ ignore = (Tokens::$ methodPrefixes + Tokens::$ phpcsCommentTokens );
79
79
$ ignore [T_WHITESPACE ] = T_WHITESPACE ;
80
80
$ functionCodeStart = $ stackPtr ;
81
- $ phpstanCommentLines = 0 ;
82
81
83
82
for ($ commentEnd = ($ stackPtr - 1 ); $ commentEnd >= 0 ; $ commentEnd --) {
84
83
if (isset ($ ignore [$ tokens [$ commentEnd ]['code ' ]]) === true ) {
@@ -101,7 +100,7 @@ public function process(File $phpcsFile, $stackPtr)
101
100
if ($ tokens [$ commentEnd ]['code ' ] === T_COMMENT
102
101
&& preg_match ('/\@phpstan-ignore/ ' , $ tokens [$ commentEnd ]['content ' ]) === 1
103
102
) {
104
- $ phpstanCommentLines += 1 ;
103
+ $ functionCodeStart = $ commentEnd ;
105
104
continue ;
106
105
}
107
106
@@ -176,7 +175,7 @@ public function process(File $phpcsFile, $stackPtr)
176
175
}
177
176
}//end foreach
178
177
179
- if ($ tokens [$ commentEnd ]['line ' ] !== ($ tokens [$ functionCodeStart ]['line ' ] - 1 - $ phpstanCommentLines )) {
178
+ if ($ tokens [$ commentEnd ]['line ' ] !== ($ tokens [$ functionCodeStart ]['line ' ] - 1 )) {
180
179
$ error = 'There must be no blank lines after the function comment ' ;
181
180
$ fix = $ phpcsFile ->addFixableError ($ error , $ commentEnd , 'SpacingAfter ' );
182
181
if ($ fix === true ) {
You can’t perform that action at this time.
0 commit comments