ElasticaProviderExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 19 2
1
<?php
2
3
namespace GBProd\ElasticaProviderBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Loader;
8
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9
10
/**
11
 * Extension class for ElasticaProviderExtension
12
 *
13
 * @author gbprod <[email protected]>
14
 */
15
class ElasticaProviderExtension extends Extension
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20 4
    public function load(array $configs, ContainerBuilder $container)
21
    {
22 4
        $configuration = new Configuration();
23 4
        $config = $this->processConfiguration($configuration, $configs);
24
    
25 4
        if (null !== $config['default_client']) {
26 1
            $container->setAlias(
27 1
                'gbprod.elastica_provider.default_client', 
28 1
                $config['default_client']
29 1
            );
30 1
        }
31
        
32 4
        $loader = new Loader\YamlFileLoader(
33 4
            $container,
34 4
            new FileLocator(__DIR__.'/../Resources/config')
35 4
        );
36
37 4
        $loader->load('services.yml');
38
    }
39
}