Failed Conditions
Push — master ( 516359...a8b39a )
by Florent
04:00
created

TestExtension   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 3
dl 0
loc 37
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2017 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace OAuth2Framework\Bundle\Server\Tests\TestBundle\DependencyInjection;
15
16
use Fluent\PhpConfigFileLoader;
17
use Symfony\Component\Config\FileLocator;
18
use Symfony\Component\DependencyInjection\ContainerBuilder;
19
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
20
21
final class TestExtension extends Extension
22
{
23
    /**
24
     * @var string
25
     */
26
    private $alias;
27
28
    /**
29
     * @param string $alias
30
     */
31
    public function __construct(string $alias)
32
    {
33
        $this->alias = $alias;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function load(array $configs, ContainerBuilder $container)
40
    {
41
        $loader = new PhpConfigFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
42
        $files = [
43
            'services',
44
        ];
45
        foreach ($files as $basename) {
46
            $loader->load(sprintf('%s.php', $basename));
47
        }
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function getAlias(): string
54
    {
55
        return $this->alias;
56
    }
57
}
58