Completed
Push — master ( da25a8...3972c2 )
by Simonas
28:32
created

ONGRRouterExtension::normalizeManagerServiceId()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 13
rs 9.4286
cc 3
eloc 8
nc 2
nop 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;
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.enable', $config['enable']);
39
        $container->setParameter('ongr_router.routers', $config['routers']);
40
        $container->setParameter('ongr_router.seo_routes', $config['seo_routes']);
41
        $container->setParameter('ongr_router.manager', $config['manager']);
42
    }
43
}
44