rector/config/set/laravel-static-to-injection.php
Tomas Votruba 7cda57615c
rename FunctionToStaticCallRector to FuncCallToStaticCallRector (#3895)
* rename FunctionToStaticCallRector to FuncCallToStaticCallRector

* rename FunctionToNewRector to FuncCallToNewRector

* remove RenameFuncCallToStaticCallRector, duplicate of FuncCallToStaticCallRector
2020-08-04 08:25:41 +00:00

29 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
use Rector\Generic\Rector\FuncCall\FuncCallToNewRector;
use Rector\Laravel\Rector\FuncCall\HelperFunctionToConstructorInjectionRector;
use Rector\Laravel\Rector\StaticCall\FacadeStaticCallToConstructorInjectionRector;
use Rector\Laravel\Rector\StaticCall\RequestStaticValidateToInjectRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import(__DIR__ . '/laravel-array-str-functions-to-static-call.php');
$services = $containerConfigurator->services();
$services->set(FacadeStaticCallToConstructorInjectionRector::class);
$services->set(RequestStaticValidateToInjectRector::class);
$services->set(HelperFunctionToConstructorInjectionRector::class);
$services->set(FuncCallToNewRector::class)
->call('configure', [[
FuncCallToNewRector::FUNCTION_TO_NEW => [
'collect' => 'Illuminate\Support\Collection',
],
]]);
};