RegisterAliceProvidersPass::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
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