XiideaEasyConfigExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 11 2
1
<?php
2
3
namespace Xiidea\EasyConfigBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Extension\Extension;
8
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
9
10
class XiideaEasyConfigExtension extends Extension
11
{
12
    public function load(array $configs, ContainerBuilder $container): void
13
    {
14
        $configuration = new Configuration();
15
        $config = $this->processConfiguration($configuration, $configs);
16
17
        foreach ($config as $key => $value) {
18
            $container->setParameter('xiidea.easy_config.' . $key, $value);
19
        }
20
21
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
22
        $loader->load('services.yaml');
23
    }
24
}
25