Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 64
ccs 39
cts 39
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 58 1
1
<?php
2
3
/**
4
* This file is part of the Meup TagCommander Bundle.
5
*
6
* (c) 1001pharmacies <http://github.com/1001pharmacies/tagcommander-bundle>
7
*
8
* For the full copyright and license information, please view the LICENSE
9
* file that was distributed with this source code.
10
*/
11
12
namespace Meup\Bundle\TagcommanderBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * 
19
 */
20
class Configuration implements ConfigurationInterface
21
{
22
    /**
23
     * {@inheritDoc}
24
     */
25 1
    public function getConfigTreeBuilder()
26
    {
27 1
        $treeBuilder = new TreeBuilder();
28 1
        $rootNode    = $treeBuilder->root('meup_tagcommander');
29
30
        $rootNode
31 1
            ->children()
32
33 1
                ->scalarNode('default_event')
34 1
                    ->defaultValue('default')
35 1
                ->end()
36
37 1
                ->arrayNode('datalayer')
38 1
                    ->children()
39 1
                        ->scalarNode('name')
40 1
                            ->defaultValue('tc_vars')
41 1
                        ->end()
42 1
                        ->variableNode('default')->end()
43 1
                    ->end()
44 1
                ->end()
45
46 1
                ->arrayNode('containers')
47 1
                    ->isRequired()
48 1
                    ->requiresAtLeastOneElement()
49 1
                    ->prototype('array')
50 1
                        ->children()
51 1
                            ->scalarNode('name')
52 1
                                ->isRequired()
53 1
                            ->end()
54 1
                            ->scalarNode('script')
55 1
                                ->isRequired()
56 1
                            ->end()
57 1
                            ->scalarNode('version')
58
                                ->defaultValue('')
59 1
                            ->end()
60 1
                            ->scalarNode('alternative')
61 1
                                ->defaultValue('')
62 1
                            ->end()
63 1
                        ->end()
64 1
                    ->end()
65 1
                ->end()
66 1
67 1
                ->arrayNode('events')
68 1
                    ->isRequired()
69
                    ->requiresAtLeastOneElement()
70 1
                    ->prototype('array')
71
                        ->children()
72
                            ->scalarNode('name')->end()
73 1
                            ->scalarNode('function')->end()
74
                        ->end()
75
                    ->end()
76
                ->end()
77
78
            ->end()
79
        ;
80
81
        return $treeBuilder;
82
    }
83
}
84