Skip to content

Commit 7ceba8b

Browse files
committed
add fixture multi space
1 parent 89f79e4 commit 7ceba8b

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace Rector\Tests\DowngradePhp73\Rector\FuncCall\DowngradeTrailingCommasInFunctionCallsRector\Fixture;
4+
5+
// @see https://3v4l.org/POahP#v7.2.17
6+
class MultiSpace
7+
{
8+
public function run()
9+
{
10+
self::run('posts','units' , );
11+
}
12+
}
13+
14+
?>
15+
-----
16+
<?php
17+
18+
namespace Rector\Tests\DowngradePhp73\Rector\FuncCall\DowngradeTrailingCommasInFunctionCallsRector\Fixture;
19+
20+
// @see https://3v4l.org/POahP#v7.2.17
21+
class MultiSpace
22+
{
23+
public function run()
24+
{
25+
self::run('posts','units');
26+
}
27+
}
28+
29+
?>

rules/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function refactor(Node $node): ?Node
9090
}
9191

9292
$tokens = $this->file->getOldTokens();
93-
if (isset($tokens[$args[$lastArgKey]->getEndTokenPos() + 1]) && $tokens[$args[$lastArgKey]->getEndTokenPos() + 1]->text === ',') {
93+
if (isset($tokens[$args[$lastArgKey]->getEndTokenPos() + 1]) && trim($tokens[$args[$lastArgKey]->getEndTokenPos() + 1]->text) === ',') {
9494
$tokens[$args[$lastArgKey]->getEndTokenPos() + 1]->text = '';
9595
}
9696

0 commit comments

Comments
 (0)