Completed
Pull Request — master (#1)
by David
07:47
created

A2lixAutoFormExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 11 1
1
<?php
2
3
namespace A2lix\AutoFormBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Processor;
6
use Symfony\Component\Config\FileLocator;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Loader;
9
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
10
11
/**
12
 * @author David ALLIX
13
 */
14
class A2lixAutoFormExtension extends Extension
15
{
16
    /**
17
     * @param array            $configs
18
     * @param ContainerBuilder $container
19
     */
20
    public function load(array $configs, ContainerBuilder $container)
21
    {
22
        $processor = new Processor();
23
        $config = $processor->processConfiguration(new Configuration(), $configs);
24
25
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
26
        $loader->load('a2lix_form.xml');
27
        $loader->load('object_info.xml');
28
29
        $container->setParameter('a2lix_auto_form.templating', $config['templating']);
30
    }
31
}
32