Skip to content

Commit

Permalink
[CodingStyle] Skip unknown method name for CallUserFuncCallToVariadic…
Browse files Browse the repository at this point in the history
…Rector [closes #2430]
  • Loading branch information
TomasVotruba committed Dec 15, 2019
1 parent a291af8 commit c07da3a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ public function refactor(Node $node): ?Node
}

$functionName = $this->getValue($node->args[0]->value);
if (!is_string($functionName)) {
return null;
}

$args = [];
$args[] = new Arg($node->args[1]->value, false, true);

return $this->createFunction($functionName, $args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Rector\CodingStyle\Tests\Rector\FuncCall\CallUserFuncCallToVariadicRector\Fixture;

class SkipUnknownValue
{
public function run($name)
{
call_user_func_array($name, $items);
}
}

0 comments on commit c07da3a

Please sign in to comment.