DynamicServiceCompilerPass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 10
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 5 2
1
<?php
2
/**
3
 * User: Simon Libaud
4
 * Date: 19/03/2017
5
 * Email: [email protected].
6
 */
7
namespace Sil\RouteSecurityBundle\DependencyInjection\Compiler;
8
9
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
10
use Symfony\Component\DependencyInjection\ContainerBuilder;
11
use Symfony\Component\DependencyInjection\Reference;
12
13
/**
14
 * Class DynamicServiceCompilerPass.
15
 */
16
class DynamicServiceCompilerPass implements CompilerPassInterface
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21 5
    public function process(ContainerBuilder $container)
22
    {
23 5
        if (null !== $naming_strategy_id = $container->getParameter('sil_route_security.naming_strategy')) {
24 1
            $container->getDefinition('sil_route_security.access_control')->replaceArgument(1, new Reference($naming_strategy_id));
25 1
            $container->getDefinition('sil_route_security.route_security_tools')->replaceArgument(1, new Reference($naming_strategy_id));
26
        }
27 5
    }
28
}
29