RdvMigrationExtension   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 3
c 3
b 1
f 0
lcom 0
cbo 5
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 15 3
1
<?php
2
3
namespace RDV\Bundle\MigrationBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
8
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9
10
class RdvMigrationExtension extends Extension
11
{
12
    public function load(array $configs, ContainerBuilder $container)
13
    {
14
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
15
        $loader->load('services.yml');
16
17
        $configuration = new Configuration();
18
        $config = $this->processConfiguration($configuration, $configs);
19
20
        foreach ($config as $key => $value) {
21
            $param = 'rdv_migration.' . $key;
22
            if (!$container->hasParameter($param)) {
23
                $container->setParameter($param, $value);
24
            }
25
        }
26
    }
27
}
28