diff --git a/rules-tests/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector/Fixture/multi_space.php.inc b/rules-tests/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector/Fixture/multi_space.php.inc new file mode 100644 index 00000000..7a6444da --- /dev/null +++ b/rules-tests/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector/Fixture/multi_space.php.inc @@ -0,0 +1,29 @@ + +----- + diff --git a/rules/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector.php b/rules/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector.php index 81e112a4..5b98c559 100644 --- a/rules/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector.php +++ b/rules/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector.php @@ -90,7 +90,7 @@ public function refactor(Node $node): ?Node } $tokens = $this->file->getOldTokens(); - if (isset($tokens[$args[$lastArgKey]->getEndTokenPos() + 1]) && $tokens[$args[$lastArgKey]->getEndTokenPos() + 1]->text === ',') { + if (isset($tokens[$args[$lastArgKey]->getEndTokenPos() + 1]) && trim($tokens[$args[$lastArgKey]->getEndTokenPos() + 1]->text) === ',') { $tokens[$args[$lastArgKey]->getEndTokenPos() + 1]->text = ''; }