Skip to content

Commit

Permalink
PEAR/FunctionDeclaration: minor efficiency tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Sep 5, 2021
1 parent 074622b commit 18c5d6f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,14 @@ public function processArgumentList($phpcsFile, $stackPtr, $indent, $type='funct
if ($tokens[$i]['code'] === T_WHITESPACE
&& $tokens[$i]['line'] !== $tokens[($i + 1)]['line']
) {
// This is an empty line, so don't check the indent.
$foundIndent = $expectedIndent;

$error = 'Blank lines are not allowed in a multi-line '.$type.' declaration';
$fix = $phpcsFile->addFixableError($error, $i, 'EmptyLine');
if ($fix === true) {
$phpcsFile->fixer->replaceToken($i, '');
}

// This is an empty line, so don't check the indent.
continue;
} else if ($tokens[$i]['code'] === T_WHITESPACE) {
$foundIndent = $tokens[$i]['length'];
} else if ($tokens[$i]['code'] === T_DOC_COMMENT_WHITESPACE) {
Expand Down

0 comments on commit 18c5d6f

Please sign in to comment.