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

GravitonProxyApiExtension::load()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2.0054

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 8
cts 9
cp 0.8889
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 9
nc 2
nop 2
crap 2.0054
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