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

MethodResolverPass   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
c 1
b 1
f 0
lcom 0
cbo 3
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 12 3
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
}