Completed
Push — master ( 755e9e...9e5cc9 )
by Florent
01:58
created

Configuration::addJWTCreatorSection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 1
eloc 12
nc 1
nop 1
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2016 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace SpomkyLabs\JoseBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
final class Configuration implements ConfigurationInterface
18
{
19
    /**
20
     * @var \SpomkyLabs\JoseBundle\DependencyInjection\Source\SourceInterface[]
21
     */
22
    private $service_sources;
23
24
    /**
25
     * @var string
26
     */
27
    private $alias;
28
29
    /**
30
     * Configuration constructor.
31
     *
32
     * @param string                                                              $alias
33
     * @param \SpomkyLabs\JoseBundle\DependencyInjection\Source\SourceInterface[] $service_sources
34
     */
35
    public function __construct($alias, array $service_sources)
36
    {
37
        $this->alias = $alias;
38
        $this->service_sources = $service_sources;
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function getConfigTreeBuilder()
45
    {
46
        $treeBuilder = new TreeBuilder();
47
        $rootNode = $treeBuilder->root($this->alias);
48
        
49
        foreach ($this->service_sources as $service_source) {
50
            $service_source->addConfigurationSection($rootNode);
51
        }
52
53
        return $treeBuilder;
54
    }
55
}
56