ZenstruckObjectRoutingExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A loadInternal() 0 10 2
1
<?php
2
3
namespace Zenstruck\ObjectRoutingBundle\DependencyInjection;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\Config\FileLocator;
7
use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension;
8
use Symfony\Component\DependencyInjection\Loader;
9
10
/**
11
 * @author Kevin Bond <[email protected]>
12
 */
13
class ZenstruckObjectRoutingExtension extends ConfigurableExtension
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18 3
    protected function loadInternal(array $mergedConfig, ContainerBuilder $container)
19
    {
20 3
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
21 3
        $loader->load('router.xml');
22
23 3
        if (count($classMap = $mergedConfig['class_map'])) {
24 2
            $container->setParameter('zenstruck_object_routing.class_map', $classMap);
25 2
            $loader->load('class_map.xml');
26
        }
27 3
    }
28
}
29