ZenstruckObjectRoutingExtension::loadInternal()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
ccs 7
cts 7
cp 1
rs 9.4286
cc 2
eloc 6
nc 2
nop 2
crap 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