Completed
Push — master ( 798ee0...2329f6 )
by Lucas
08:18
created

GravitonCoreExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 28
ccs 2
cts 2
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfigDir() 0 4 1
A load() 0 10 1
1
<?php
2
/**
3
 * manage and load bundle config.
4
 */
5
6
namespace Graviton\CoreBundle\DependencyInjection;
7
8
use Graviton\BundleBundle\DependencyInjection\GravitonBundleExtension;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
11
/**
12
 * This is the class that loads and manages your bundle configuration
13
 *
14
 * To learn more see {@link http://scm.to/004w}
15
 *
16
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
17
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
18
 * @link     http://swisscom.ch
19
 */
20
class GravitonCoreExtension extends GravitonBundleExtension
21
{
22
    /**
23
     * {@inheritDoc}
24
     *
25
     * @return string
26 1
     */
27
    public function getConfigDir()
28 1
    {
29
        return __DIR__.'/../Resources/config';
30
    }
31
32
    /**
33
     * @param array            $configs   parameters configuration
34
     * @param ContainerBuilder $container Symfony container
35
     * @return void
36
     */
37
    public function load(array $configs, ContainerBuilder $container)
38
    {
39
        parent::load($configs, $container);
40
        $configuration = new Configuration();
41
        $this->processConfiguration($configuration, $configs);
42
43
        $container->setParameter('graviton.core.links', $configs[0]['service_name']);
44
        $container->setParameter('graviton.core.main.path.whitelist', $configs[0]['uri_whitelist']);
45
46
    }
47
}
48