Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 12, 2024
1 parent 7ceba8b commit 618a92f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MultiSpace
{
public function run()
{
self::run('posts','units');
self::run('posts','units' );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,15 @@ public function refactor(Node $node): ?Node
}

$tokens = $this->file->getOldTokens();
if (isset($tokens[$args[$lastArgKey]->getEndTokenPos() + 1]) && trim($tokens[$args[$lastArgKey]->getEndTokenPos() + 1]->text) === ',') {
$tokens[$args[$lastArgKey]->getEndTokenPos() + 1]->text = '';
$iteration = 1;

while (isset($tokens[$args[$lastArgKey]->getEndTokenPos() + $iteration])) {
if (trim($tokens[$args[$lastArgKey]->getEndTokenPos() + $iteration]->text) === ',') {
$tokens[$args[$lastArgKey]->getEndTokenPos() + $iteration]->text = '';
break;
}

++$iteration;
}

return $node;
Expand Down

0 comments on commit 618a92f

Please sign in to comment.