Completed
Push — master ( a70ca2...b8c2a5 )
by Daniel
14:22
created

MethodResolverPass::process()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 12
rs 9.4285
cc 3
eloc 6
nc 3
nop 1
1
<?php
2
3
namespace Cmobi\RabbitmqBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Reference;
8
9
class MethodResolverPass implements CompilerPassInterface
10
{
11
    public function process(ContainerBuilder $container)
12
    {
13
        if (false === $container->hasDefinition('rpc_routing.resolver')) {
14
            return;
15
        }
16
17
        $definition = $container->getDefinition('rpc_routing.resolver');
18
19
        foreach ($container->findTaggedServiceIds('routing.loader') as $id => $attributes) {
20
            $definition->addMethodCall('addLoader', array(new Reference($id)));
21
        }
22
    }
23
}