Merge name === type service registration, $services->set(SomeType::class, SomeType::class)
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
- $services->set(\App\SomeClass::class, \App\SomeClass::class);
+ $services->set(\App\SomeClass::class);
};
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Symfony\Configs\Rector\Closure\MergeServiceNameTypeRector;
return RectorConfig::configure()
->withRules([
MergeServiceNameTypeRector::class,
]);