rector/config/set/doctrine-services.php
dobryy 28a55c973e
[DX] Add Rule that checks that Rule + value object have same starts (#4202)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-12 23:19:08 +02:00

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'
),
]),
]]);
};