AeFeatureExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 2
dl 0
loc 14
ccs 9
cts 9
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Ae\FeatureBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
8
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9
10
/**
11
 * This is the class that loads and manages your bundle configuration.
12
 *
13
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
14
 */
15
class AeFeatureExtension extends Extension
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20 17
    public function load(array $configs, ContainerBuilder $container)
21
    {
22 17
        $configuration = new Configuration();
23 17
        $config = $this->processConfiguration($configuration, $configs);
24
25 17
        $loader = new XmlFileLoader(
26 17
            $container,
27 17
            new FileLocator(__DIR__.'/../Resources/config')
28
        );
29
30 17
        $loader->load('services.xml');
31
32 17
        $container->setAlias('ae_feature.cache', $config['cache']);
33 17
        $container->setParameter('ae_feature.provider_key', $config['provider_key']);
34 17
    }
35
}
36