AddExtensionsPass   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 18
ccs 8
cts 9
cp 0.8889
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 14 3
1
<?php
2
3
namespace Goetas\TwitalBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Reference;
8
9
/**
10
 *
11
 * @author Asmir Mustafic <[email protected]>
12
 *
13
 */
14
class AddExtensionsPass implements CompilerPassInterface
15
{
16
17 8
    public function process(ContainerBuilder $container)
18
    {
19 8
        if (false === $container->hasDefinition('twital')) {
20
            return;
21
        }
22
23 8
        $twitalDefinition = $container->getDefinition('twital');
24 8
        $extensionsIds = $container->findTaggedServiceIds('twital.extension');
25 8
        foreach ($extensionsIds as $extensionId => $params) {
26 8
            $twitalDefinition->addMethodCall('addExtension', array(
27 8
                new Reference($extensionId)
28
            ));
29
        }
30 8
    }
31
}
32