SetRouterPass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
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
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ONGR\RouterBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Reference;
17
18
class SetRouterPass implements CompilerPassInterface
19
{
20
    public function process(ContainerBuilder $container)
21
    {
22
        if (!$container->getParameter('ongr_router.disable_alias')) {
23
            $container->setAlias('router', 'ongr_router.chain_router');
24
        }
25
26
        $container
27
            ->getDefinition('ongr_router.elasticsearch_route_provider')
28
            ->addMethodCall(
29
                'setManager',
30
                [new Reference($container->getParameter('ongr_router.manager'))]
31
            );
32
    }
33
}
34