mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-11 19:15:10 +01:00
29 lines
1.1 KiB
PHP
29 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use function Rector\SymfonyPhpConfig\inline_value_objects;
|
|
use Rector\Transform\Rector\MethodCall\ServiceGetterToConstructorInjectionRector;
|
|
use Rector\Transform\ValueObject\ServiceGetterToConstructorInjection;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
$services = $containerConfigurator->services();
|
|
|
|
$services->set(ServiceGetterToConstructorInjectionRector::class)
|
|
->call('configure', [[
|
|
ServiceGetterToConstructorInjectionRector::METHOD_CALL_TO_SERVICES => inline_value_objects([
|
|
new ServiceGetterToConstructorInjection(
|
|
'Doctrine\Common\Persistence\ManagerRegistry',
|
|
'getConnection',
|
|
'Doctrine\DBAL\Connection'
|
|
),
|
|
new ServiceGetterToConstructorInjection(
|
|
'Doctrine\ORM\EntityManagerInterface',
|
|
'getConfiguration',
|
|
'Doctrine\ORM\Configuration'
|
|
),
|
|
]),
|
|
]]);
|
|
};
|