BlackCommonExtension::load()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 2
1
<?php
2
3
/*
4
 * This file is part of the Black package.
5
 *
6
 * (c) Alexandre Balmes <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Black\Bundle\CommonBundle\DependencyInjection;
13
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\Config\FileLocator;
16
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
17
use Symfony\Component\DependencyInjection\Loader;
18
19
/**
20
 * Class BlackCommonExtension
21
 *
22
 * This is the class that loads and manages your bundle configuration
23
 *
24
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
25
 */
26
class BlackCommonExtension extends Extension
27
{
28
    /**
29
     * {@inheritDoc}
30
     */
31
    public function load(array $configs, ContainerBuilder $container)
32
    {
33
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
34
35
        foreach (['services'] as $service) {
36
            $loader->load(sprintf('%s.yml', $service));
37
        }
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getAlias()
44
    {
45
        return 'black_common';
46
    }
47
}
48