ElasticaSpecificationExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 5
dl 0
loc 22
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 16 1
1
<?php
2
3
namespace GBProd\ElasticaSpecificationBundle\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 ElasticaSpecificationBundle
12
 *
13
 * @author gbprod <[email protected]>
14
 */
15
class ElasticaSpecificationExtension extends Extension
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20 6
    public function load(array $configs, ContainerBuilder $container)
21
    {
22 6
        $configuration = new Configuration();
23 6
        $config = $this->processConfiguration($configuration, $configs);
24 6
        $container->setParameter(
25 6
            'gbprod.elastica_specification_dsl.class',
26 6
            'Elastica\\QueryBuilder\\Version\\'.$config['dsl_version']
27
        );
28
29 6
        $loader = new Loader\YamlFileLoader(
30 6
            $container,
31 6
            new FileLocator(__DIR__.'/../Resources/config')
32
        );
33
34 6
        $loader->load('services.yml');
35 6
    }
36
}
37