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

GravitonCoreExtension::getConfigDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1
Metric Value
dl 0
loc 4
rs 10
ccs 1
cts 1
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 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