Change $services->set(..., ...)->tag(...) to $services->defaults()->autodiscovery() where meaningful
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use App\Command\SomeCommand;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
+ $services->defaults()
+ ->autoconfigure();
- $services->set(SomeCommand::class)
- ->tag('console.command');
+ $services->set(SomeCommand::class);
};
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Symfony\Configs\Rector\Closure\ServiceTagsToDefaultsAutoconfigureRector;
return RectorConfig::configure()
->withRules([
ServiceTagsToDefaultsAutoconfigureRector::class,
]);