Skip to content

Commit 404c19a

Browse files
committed
final touch: do not try to remove trailig comma multiple times
1 parent e6f6994 commit 404c19a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/PhpParser/Internal/TokenStream.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ public function getTokenCode(int $from, int $to, int $indent, bool $removeTraili
229229

230230
if ($removeTrailingComma && $token->text === ',') {
231231
$token->text = '';
232+
// don't try to remove trailing comma multiple times
233+
$removeTrailingComma = false;
232234
}
233235

234236
$text = $token->text;

0 commit comments

Comments
 (0)