hasDefinition(ImportChain::class)) { return; } $definition = $container->getDefinition( ImportChain::class ); $taggedServices = $container->findTaggedServiceIds( 'wallabag.import' ); foreach ($taggedServices as $id => $tagAttributes) { foreach ($tagAttributes as $attributes) { $definition->addMethodCall( 'addImport', [new Reference($id), $attributes['alias']] ); } } } }