Refactor call_user_func() on known class method to a method call
final class SomeClass
{
public function run()
{
- $result = \call_user_func([$this->property, 'method'], $args);
+ $result = $this->property->method($args);
}
}
Configure your rector.php
:
<?php
use Rector\CodingStyle\Rector\FuncCall\CallUserFuncToMethodCallRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
CallUserFuncToMethodCallRector::class,
]);