LugUiExtension   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 3
dl 0
loc 20
ccs 10
cts 10
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 14 3
1
<?php
2
3
/*
4
 * This file is part of the Lug package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Lug\Bundle\UiBundle\DependencyInjection;
13
14
use Symfony\Component\Config\FileLocator;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Extension\Extension;
17
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
18
use Symfony\Component\Form\Forms;
19
20
/**
21
 * @author GeLo <[email protected]>
22
 */
23
class LugUiExtension extends Extension
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28 2
    public function load(array $config, ContainerBuilder $container)
29
    {
30 2
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
31
32 2
        $resources = ['menu'];
33
34 2
        if (class_exists(Forms::class)) {
35 2
            $resources[] = 'form';
36 2
        }
37
38 2
        foreach ($resources as $resource) {
39 2
            $loader->load($resource.'.xml');
40 2
        }
41 2
    }
42
}
43