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

A2lixAutoFormExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4286
cc 1
eloc 7
nc 1
nop 2
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