Skip to content

Commit 588914e

Browse files
committed
Simplify by using same tactic as phpcs comments
1 parent 30eac2a commit 588914e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function process(File $phpcsFile, $stackPtr)
101101
if ($tokens[$commentEnd]['code'] === T_COMMENT
102102
&& preg_match('/\@phpstan-ignore/', $tokens[$commentEnd]['content']) === 1
103103
) {
104-
$phpstanCommentLines += 1;
104+
$functionCodeStart = $commentEnd;
105105
continue;
106106
}
107107

@@ -176,7 +176,7 @@ public function process(File $phpcsFile, $stackPtr)
176176
}
177177
}//end foreach
178178

179-
if ($tokens[$commentEnd]['line'] !== ($tokens[$functionCodeStart]['line'] - 1 - $phpstanCommentLines)) {
179+
if ($tokens[$commentEnd]['line'] !== ($tokens[$functionCodeStart]['line'] - 1)) {
180180
$error = 'There must be no blank lines after the function comment';
181181
$fix = $phpcsFile->addFixableError($error, $commentEnd, 'SpacingAfter');
182182
if ($fix === true) {

0 commit comments

Comments
 (0)