Completed
Pull Request — develop (#605)
by
unknown
14:48
created

GravitonProxyApiExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 22
ccs 8
cts 9
cp 0.8889
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 14 2
1
<?php
2
/**
3
 * Extension config and loader
4
 */
5
namespace Graviton\ProxyApiBundle\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
 * Basic functional test for ProxyApi
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 GravitonProxyApiExtension extends Extension
20
{
21
    /**
22
     * @param array            $configs   Optional configuration
23
     * @param ContainerBuilder $container Sf Container
24
     * @return void
25
     */
26 2
    public function load(array $configs, ContainerBuilder $container)
27
    {
28 2
        $configuration = new Configuration();
29 2
        $this->processConfiguration($configuration, $configs);
30
31 2
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
32 2
        $loader->load('services.yml');
33
34 2
        if ('test' !== $container->getParameter("kernel.environment")) {
35
            $loader->load('parameters.yml');
36
        } else {
37 2
            $loader->load('parameters_test.yml');
38
        }
39 2
    }
40
}
41