Completed
Push — feature/evo-2472-whoami ( aca89f...28fd37 )
by Jan
21:32 queued 10:36
created

GravitonCoreExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
ccs 0
cts 0
cp 0
cc 1
eloc 6
nc 1
nop 2
crap 2
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
 * This is the class that loads and manages your bundle configuration
12
 *
13
 * To learn more see {@link http://scm.to/004w}
14
 *
15
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
16
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
17
 * @link     http://swisscom.ch
18
 */
19
class GravitonCoreExtension extends GravitonBundleExtension
20
{
21
    /**
22
     * {@inheritDoc}
23
     *
24
     * @return string
25
     */
26 1
    public function getConfigDir()
27
    {
28 1
        return __DIR__.'/../Resources/config';
29
    }
30
31
    public function load(array $configs, ContainerBuilder $container)
32
    {
33
        parent::load($configs, $container);
34
        $configuration = new Configuration();
35
        $this->processConfiguration($configuration, $configs);
36
37
        $container->setParameter('graviton.core.links', $configs[0]['service_name']);
38
        $container->setParameter('graviton.core.main.path.whitelist', $configs[0]['uri_whitelist']);
39
40
    }
41
}
42