HumanizerExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 10
cts 10
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 2
crap 1
1
<?php
2
3
namespace EmanueleMinotto\HumanizerBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Loader;
8
use Symfony\Component\DependencyInjection\Reference;
9
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
10
11
/**
12
 * {@inheritdoc}
13
 */
14
class HumanizerExtension extends Extension
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19 12
    public function load(array $configs, ContainerBuilder $container)
20
    {
21 12
        $config = $this->processConfiguration(new Configuration(), $configs);
22
23 12
        $loader = new Loader\XmlFileLoader(
24 8
            $container,
25 12
            new FileLocator(__DIR__.'/../Resources/config')
26 4
        );
27 12
        $loader->load('services.xml');
28
29
        $container
30 12
            ->getDefinition('humanizer_bundle.twig.abstract_humanizer_extension')
31 12
            ->replaceArgument(0, new Reference($config['translator']));
32 12
    }
33
}
34