PoolerPass::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 13
rs 9.8333
cc 2
nc 2
nop 1
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