BestItKitchensinkExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
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 25
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 11 1
1
<?php
2
3
namespace BestIt\KitchensinkBundle\DependencyInjection;
4
5
use Exception;
6
use InvalidArgumentException;
7
use Symfony\Component\Config\FileLocator;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
use Symfony\Component\DependencyInjection\Extension\Extension;
10
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
11
12
/**
13
 * Loading the bundle.
14
 *
15
 * @author blange <[email protected]>
16
 * @package BestIt\KitchensinkBundle
17
 */
18
class BestItKitchensinkExtension extends Extension
19
{
20
    /**
21
     * Loads a specific configuration.
22
     *
23
     * @param array $configs An array of configuration values
24
     * @param ContainerBuilder $container A ContainerBuilder instance
25
     *
26
     * @throws InvalidArgumentException When provided tag is not defined in this extension
27
     * @throws Exception Unknown errors
28
     *
29
     * @return void
30
     */
31 2
    public function load(array $configs, ContainerBuilder $container)
32
    {
33 2
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
34 2
        $loader->load('services.yml');
35
36 2
        $config = $this->processConfiguration(new Configuration(), $configs);
37
38 1
        $container->setAlias('best_it_kitchensink.data_provider', $config['data_provider']);
39 1
        $container->setAlias('best_it_kitchensink.template_engine', $config['template_engine']);
40 1
        $container->setParameter('best_it_kitchensink.template', $config['template']);
41 1
    }
42
}
43