Completed
Push — master ( 6d5669...ad217e )
by Daniel
04:41
created

NarratorExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 7
cts 7
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 * @package narrator-bundle
4
 */
5
6
namespace Mleko\Narrator\Bundle\DependencyInjection;
7
8
use Mleko\Narrator\Bundle\DependencyInjection\Configuration\EventBusConfiguration;
9
use Symfony\Component\Config\FileLocator;
10
use Symfony\Component\DependencyInjection\ContainerBuilder;
11
use Symfony\Component\DependencyInjection\Loader;
12
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
13
14
/**
15
 * This is the class that loads and manages your bundle configuration
16
 *
17
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
18
 */
19
class NarratorExtension extends Extension
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24 3
    public function load(array $configs, ContainerBuilder $container)
25
    {
26 3
        $configuration = new Configuration();
27 3
        $config = $this->processConfiguration($configuration, $configs);
28
29 3
        (new EventBusConfiguration())->configureEventBus($config['event_bus'], $container);
30
31 3
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
32 3
        $loader->load('services.xml');
33 3
    }
34
}
35