Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 27
dl 0
loc 40
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 35 1
1
<?php
2
3
namespace LSB\NumberingBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * @codeCoverageIgnore
10
 * This is the class that validates and merges configuration from your app/config files.
11
 *
12
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
13
 */
14
class Configuration implements ConfigurationInterface
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function getConfigTreeBuilder()
20
    {
21
        $treeBuilder = new TreeBuilder('lsb_numbering');
22
23
        $rootNode = $treeBuilder->getRootNode();
24
        $rootNode
25
            ->children()
26
                // patterns
27
                ->arrayNode('patterns')
28
                    ->arrayPrototype()
29
                        ->children()
30
                            ->scalarNode('name')->end()
31
                            ->scalarNode('pattern')->end()
32
                        ->end()
33
                    ->end()
34
                ->end()
35
36
37
                // counter_configs
38
                ->arrayNode('counter_configs')
39
                    ->arrayPrototype()
40
                        ->children()
41
                            ->scalarNode('name')->end()
42
                            ->scalarNode('patternName')->end()
43
                            ->scalarNode('start')->end()
44
                            ->scalarNode('step')->end()
45
                            ->scalarNode('time_context')->end() //TODO ograniczenie zestawu wartości, enum?
46
                            ->scalarNode('context_object_fqcn')->end()
47
                        ->end()
48
                    ->end()
49
                ->end()
50
51
            ->end();
52
53
        return $treeBuilder;
54
    }
55
}
56