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

GravitonAuditTrackingExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 81.82%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 25
ccs 9
cts 11
cp 0.8182
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 16 2
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