Completed
Pull Request — master (#16)
by Arnaud
48:07 queued 29:02
created

LAGSmokerExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 19 1
A getAlias() 0 3 1
1
<?php
2
3
namespace LAG\SmokerBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Extension\Extension;
8
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
9
10
class LAGSmokerExtension extends Extension
11
{
12
    public function load(array $configs, ContainerBuilder $container)
13
    {
14
        $configuration = new Configuration();
15
        $config = $this->processConfiguration($configuration, $configs);
16
17
        $loader = new YamlFileLoader(
18
            $container,
19
            new FileLocator(__DIR__.'/../Resources/config/services')
20
        );
21
        $loader->load('collectors.yaml');
22
        $loader->load('commands.yaml');
23
        $loader->load('handlers.yaml');
24
        $loader->load('providers.yaml');
25
        $loader->load('registries.yaml');
26
        $loader->load('resolvers.yaml');
27
28
        $container->setParameter('lag_smoker.mapping', $config['mapping']);
29
        $container->setParameter('lag_smoker.routes', $config['routes']);
30
        $container->setParameter('lag_smoker.routing', $config['routing']);
31
    }
32
33
    public function getAlias()
34
    {
35
        return 'lag_smoker';
36
    }
37
}
38