NarratorExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 10 1
1
<?php
2
/**
3
 * Narrator Bundle
4
 *
5
 * @link      http://github.com/mleko/narrator-bundle
6
 * @copyright Copyright (c) 2017 Daniel Król
7
 * @license   MIT
8
 */
9
10
11
namespace Mleko\Narrator\Bundle\DependencyInjection;
12
13
use Mleko\Narrator\Bundle\DependencyInjection\Configuration\EventBusConfiguration;
14
use Symfony\Component\Config\FileLocator;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Loader;
17
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
18
19
/**
20
 * This is the class that loads and manages your bundle configuration
21
 *
22
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
23
 */
24
class NarratorExtension extends Extension
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29 5
    public function load(array $configs, ContainerBuilder $container)
30
    {
31 5
        $configuration = new Configuration();
32 5
        $config = $this->processConfiguration($configuration, $configs);
33
34 5
        (new EventBusConfiguration())->configureEventBus($config['event_bus'], $container);
35
36 5
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
37 5
        $loader->load('services.xml');
38 5
    }
39
}
40