3 namespace Wallabag\ImportBundle\Import
;
5 use Symfony\Component\DependencyInjection\ContainerBuilder
;
6 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface
;
7 use Symfony\Component\DependencyInjection\Reference
;
9 class ImportCompilerPass
implements CompilerPassInterface
11 public function process(ContainerBuilder
$container)
13 if (!$container->hasDefinition('wallabag_import.chain')) {
17 $definition = $container->getDefinition(
18 'wallabag_import.chain'
21 $taggedServices = $container->findTaggedServiceIds(
22 'wallabag_import.import'
24 foreach ($taggedServices as $id => $tagAttributes) {
25 foreach ($tagAttributes as $attributes) {
26 $definition->addMethodCall(
28 [new Reference($id), $attributes['alias']]