tagName = $tagName; } public function process(ContainerBuilder $container): void { foreach ($container->findTaggedServiceIds($this->tagName) as $id => $tags) { $definition = $container->findDefinition($id); if (!$definition->isAutoconfigured() || $definition->isAbstract()) { continue; } // Singletons need to be shared (that's symfony's configuration for singletons) // They need to be public to be available for legacy makeInstance usage. $definition->setShared(true)->setPublic(true); } } }