PoolerPass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 13 2
1
<?php
2
/*
3
 * This file is part of the PommProject/PommBundle package.
4
 *
5
 * (c) 2014 - 2016 Grégoire HUBERT <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace PommProject\PommBundle\DependencyInjection\Compiler;
11
12
use Symfony\Component\DependencyInjection as DI;
13
14
/**
15
 * Class PoolerPass
16
 * @package PommProject\PommBundle\DependencyInjection\Compiler
17
 * @author  Miha Vrhovnik
18
 */
19
class PoolerPass implements DI\Compiler\CompilerPassInterface
20
{
21
    public function process(DI\ContainerBuilder $container)
22
    {
23
        // find all service IDs with the appropriate tag
24
        $taggedServices = $container->findTaggedServiceIds('pomm.pooler');
25
26
        $poolers = [];
27
        foreach ($taggedServices as $id => $tags) {
28
            $poolers[] = new DI\Reference($id);
29
        }
30
31
        $definition = $container->getDefinition('pomm.session_builder.configurator');
32
        $definition->replaceArgument(0, $poolers);
33
    }
34
}
35