Skip to content

Commit ea3aef4

Browse files
committed
Fixed phpstan issues
1 parent 712b503 commit ea3aef4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/PhpCsFixer/Rule/MultilineParametersFixer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ protected function applyFix(
4444
}
4545

4646
$openParenIndex = $tokens->getNextTokenOfKind($index, ['(']);
47+
if ($openParenIndex === null) {
48+
continue;
49+
}
50+
4751
$closeParenIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $openParenIndex);
4852

4953
// Count commas to determine parameter count
@@ -150,7 +154,7 @@ private function makeMultiline(
150154

151155
// Handle the opening brace
152156
$nextNonWhitespace = $tokens->getNextNonWhitespace($closeParenIndex);
153-
if ($nextNonWhitespace !== null && $tokens[$nextNonWhitespace]->equals(T_CURLY_OPEN)) {
157+
if ($nextNonWhitespace !== null && $tokens[$nextNonWhitespace]->equals('{')) {
154158
$tokens->ensureWhitespaceAtIndex($nextNonWhitespace - 1, 1, ' ');
155159
}
156160
}

0 commit comments

Comments
 (0)