CallUserFuncWithArrowFunctionToInlineRector

Refactor call_user_func() with arrow function to direct call

 final class SomeClass
 {
     public function run()
     {
-        $result = \call_user_func(fn () => 100);
+        $result = 100;
     }
 }

Configure your rector.php:

<?php

use Rector\CodeQuality\Rector\FuncCall\CallUserFuncWithArrowFunctionToInlineRector;
use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withRules([
        CallUserFuncWithArrowFunctionToInlineRector::class,
    ]);
SETS:  Code Quality