Skip to content

Commit f0170a8

Browse files
committed
[DowngradePhp73] Fix complex next arg on DowngradeTrailingCommasInFunctionCallsRector
1 parent 3aebc81 commit f0170a8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rules/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ public function refactor(Node $node): ?Node
9393
$iteration = 1;
9494

9595
while (isset($tokens[$args[$lastArgKey]->getEndTokenPos() + $iteration])) {
96+
if (trim($tokens[$args[$lastArgKey]->getEndTokenPos() + $iteration]->text) === '') {
97+
continue;
98+
}
99+
100+
if (trim($tokens[$args[$lastArgKey]->getEndTokenPos() + $iteration]->text) !== ',') {
101+
break;
102+
}
103+
96104
if (trim($tokens[$args[$lastArgKey]->getEndTokenPos() + $iteration]->text) === ',') {
97105
$tokens[$args[$lastArgKey]->getEndTokenPos() + $iteration]->text = '';
98106
break;

0 commit comments

Comments
 (0)