Completed
Push — master ( d5349d...2edaf3 )
by Yann
9s
created

EnumExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 13
ccs 0
cts 11
cp 0
rs 9.4285
cc 1
eloc 9
nc 1
nop 2
crap 2
1
<?php
2
3
namespace Yokai\EnumBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
8
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9
10
/**
11
 * @author Yann Eugoné <[email protected]>
12
 */
13
class EnumExtension extends Extension
14
{
15
    /**
16
     * @inheritdoc
17
     */
18
    public function load(array $configs, ContainerBuilder $container)
19
    {
20
        $configuration = new Configuration();
21
        $config = $this->processConfiguration($configuration, $configs);
22
23
        $container->setParameter('enum.register_bundles', $config['register_bundles']);
24
25
        $xmlLoader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
26
        $xmlLoader->load('services.xml');
27
        $xmlLoader->load('form_types.xml');
28
        $xmlLoader->load('validators.xml');
29
        $xmlLoader->load('twig.xml');
30
    }
31
}
32