mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 19:53:14 +01:00
* [SymfonyPhpConfig] Use Symplify package instead * [SymfonyPhpConfig] Drop forgotten custom-jobs Rectors * [CI] simplify set validation * from inline functions to Static class * cleanup * decouple rector.php to allow static analysis and coding standards
29 lines
1.1 KiB
PHP
29 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Rector\Transform\Rector\MethodCall\ServiceGetterToConstructorInjectionRector;
|
|
use Rector\Transform\ValueObject\ServiceGetterToConstructorInjection;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
$services = $containerConfigurator->services();
|
|
|
|
$services->set(ServiceGetterToConstructorInjectionRector::class)
|
|
->call('configure', [[
|
|
ServiceGetterToConstructorInjectionRector::METHOD_CALL_TO_SERVICES => ValueObjectInliner::inline([
|
|
new ServiceGetterToConstructorInjection(
|
|
'Doctrine\Common\Persistence\ManagerRegistry',
|
|
'getConnection',
|
|
'Doctrine\DBAL\Connection'
|
|
),
|
|
new ServiceGetterToConstructorInjection(
|
|
'Doctrine\ORM\EntityManagerInterface',
|
|
'getConfiguration',
|
|
'Doctrine\ORM\Configuration'
|
|
),
|
|
]),
|
|
]]);
|
|
};
|