RegisterAliceProvidersPass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 7 2
1
<?php
2
3
namespace Knp\RadBundle\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 RegisterAliceProvidersPass implements CompilerPassInterface
10
{
11
    public function process(ContainerBuilder $container)
12
    {
13
        $collectionDefinition = $container->getDefinition('knp_rad.alice.provider_collection');
14
        foreach (array_keys($container->findTaggedServiceIds('alice.provider')) as $id) {
15
            $collectionDefinition->addMethodCall('addProvider', array(new Reference($id)));
16
        }
17
    }
18
}
19