TrelloConfiguration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 34
Code Lines 29

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 29
dl 0
loc 34
ccs 0
cts 32
cp 0
rs 9.456
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Scrumban\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
class TrelloConfiguration implements ConfigurationInterface
9
{
10
    
11
    public function getConfigTreeBuilder(): TreeBuilder
12
    {
13
        $treeBuilder = new TreeBuilder();
14
        $rootNode = $treeBuilder->root('scrumban');
15
        
16
        $rootNode
17
            ->children()
18
                ->arrayNode('trello')->canBeUnset()
19
                    ->children()
20
                        ->booleanNode('has_plus_for_trello')->end()
21
                        ->arrayNode('boards')
22
                            ->useAttributeAsKey('n')
23
                            ->prototype('array')
24
                                ->children()
25
                                    ->scalarNode('id')->end()
26
                                ->end()
27
                            ->end()
28
                        ->end()
29
                        ->arrayNode('columns')
30
                            ->useAttributeAsKey('n')
31
                            ->prototype('array')
32
                                ->children()
33
                                    ->scalarNode('name')->end()
34
                                    ->scalarNode('type')->end()
35
                                    ->scalarNode('status')->end()
36
                                ->end()
37
                            ->end()
38
                        ->end()
39
                    ->end()
40
                ->end()
41
            ->end()
42
        ;
43
        
44
        return $treeBuilder;
45
    }
46
47
}