Completed
Push — feature/EVO-7278-tracking-info... ( e99586...a5fe2c )
by
unknown
11:44
created

GravitonAuditTrackingExtension::load()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 2.024

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 9
cts 11
cp 0.8182
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 10
nc 2
nop 2
crap 2.024
1
<?php
2
/**
3
 * Sf Extension for Audit Bundle
4
 */
5
namespace Graviton\AuditTrackingBundle\DependencyInjection;
6
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\Config\FileLocator;
9
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
10
use Symfony\Component\DependencyInjection\Loader;
11
12
/**
13
 * This is the class that loads and manages your bundle configuration.
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 GravitonAuditTrackingExtension extends Extension
20
{
21
    /**
22
     * @param array            $configs   Data for configuration
23
     * @param ContainerBuilder $container Sf container
24
     *
25
     * @return void
26
     */
27 2
    public function load(array $configs, ContainerBuilder $container)
28
    {
29 2
        $configuration = new Configuration();
30 2
        $config = $this->processConfiguration($configuration, $configs);
31 2
        $environment = $container->getParameter("kernel.environment");
32
33 2
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
34 2
        $loader->load('services.yml');
35
36
        // Some configurations are turned on so tests are run with Tests user.
37 2
        if ($environment !== 'test') {
38
            $loader->load('parameters.yml');
39
        } else {
40 2
            $loader->load('parameters_dev.yml');
41
        }
42 2
    }
43
}
44