Configuration   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 3
c 2
b 1
f 0
lcom 1
cbo 2
dl 0
loc 39
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getConfigTreeBuilder() 0 11 2
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->getNodeDefinition($rootNode);
51
        }
52
53
        return $treeBuilder;
54
    }
55
}
56