Completed
Push — master ( e111ee...b6ca56 )
by Artem
04:57
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 24
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 18 1
1
<?php
2
3
//----------------------------------------------------------------------
4
//
5
//  Copyright (C) 2017 Artem Rodygin
6
//
7
//  You should have received a copy of the MIT License along with
8
//  this file. If not, see <http://opensource.org/licenses/MIT>.
9
//
10
//----------------------------------------------------------------------
11
12
namespace Pignus\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * Validates and merges configuration from app/config files.
19
 *
20
 * @see http://symfony.com/doc/current/cookbook/bundles/configuration.html
21
 */
22
class Configuration implements ConfigurationInterface
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27 5
    public function getConfigTreeBuilder()
28
    {
29 5
        $treeBuilder = new TreeBuilder();
30 5
        $rootNode    = $treeBuilder->root('pignus');
31
32
        $rootNode
33 5
            ->children()
34 5
                ->booleanNode('unauthorized_request')
35 5
                    ->defaultFalse()
36 5
                ->end()
37 5
                ->arrayNode('login')
38 5
                    ->requiresAtLeastOneElement()
39 5
                    ->prototype('scalar')->end()
40 5
                ->end()
41 5
            ->end();
42
43 5
        return $treeBuilder;
44
    }
45
}
46