Completed
Push — master ( e6cdbc...9c797c )
by Kristof
40:05 queued 25:37
created

KunstmaanDashboardExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 9 1
A prepend() 0 4 1
1
<?php
2
3
namespace Kunstmaan\DashboardBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
8
use Symfony\Component\DependencyInjection\Loader;
9
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
10
11
/**
12
 * This is the class that loads and manages your bundle configuration
13
 *
14
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
15
 */
16
class KunstmaanDashboardExtension extends Extension implements PrependExtensionInterface
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function load(array $configs, ContainerBuilder $container)
22
    {
23
        $configuration = new Configuration();
24
        $this->processConfiguration($configuration, $configs);
25
26
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
27
        $loader->load('services.yml');
28
        $loader->load('commands.yml');
29
    }
30
31
    public function prepend(ContainerBuilder $container)
32
    {
33
        $container->prependExtensionConfig('framework', ['esi' => ['enabled' => true]]);
34
    }
35
}
36