ONGRRouterExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 6
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 16 1
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;
13
14
use Symfony\Component\Config\FileLocator;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Loader;
17
use Symfony\Component\DependencyInjection\Reference;
18
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
19
20
/**
21
 * This is the class that loads and manages your bundle configuration.
22
 *
23
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
24
 */
25
class ONGRRouterExtension extends Extension
26
{
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function load(array $configs, ContainerBuilder $container)
31
    {
32
        $configuration = new Configuration();
33
        $config = $this->processConfiguration($configuration, $configs);
34
35
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
36
        $loader->load('services.yml');
37
38
        $container->setParameter('ongr_router.manager', $config['manager']);
39
        $container->setParameter('ongr_router.disable_alias', $config['disable_alias']);
40
        $container->setParameter('ongr_router.seo_routes', $config['seo_routes']);
41
42
        $container
43
            ->getDefinition('ongr_router.dynamic_router')
44
            ->addTag('router', ['priority' => $config['router_priority']]);
45
    }
46
}
47