Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 43
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 35 1
1
<?php
2
3
namespace Rezzza\SecurityBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * Configuration
10
 *
11
 * @uses ConfigurationInterface
12
 * @author Stephane PY <[email protected]>
13
 */
14
class Configuration implements ConfigurationInterface
15
{
16
    /**
17
     * Generates the configuration tree builder.
18
     *
19
     * @return TreeBuilder The tree builder
20
     */
21
    public function getConfigTreeBuilder()
22
    {
23
        $tb       = new TreeBuilder();
24
        $rootNode = $tb->root('rezzza_security');
25
26
        $rootNode
27
            ->children()
28
                ->arrayNode('request_obfuscator')
29
                    ->addDefaultsIfNotSet()
30
                    ->children()
31
                        ->booleanNode('enabled')->defaultFalse()->end()
32
                    ->end()
33
                ->end()
34
                ->arrayNode('firewalls')
35
                    ->useAttributeAsKey('name')
36
                    ->prototype('array')
37
                        ->children()
38
                            ->scalarNode('algorithm')
39
                                ->defaultValue('SHA1')
40
                            ->end()
41
                            ->scalarNode('secret')
42
                                ->isRequired()
43
                                ->cannotBeEmpty()
44
                            ->end()
45
                            ->booleanNode('replay_protection')
46
                                ->defaultValue(true)
47
                            ->end()
48
                        ->end()
49
                    ->end()
50
                ->end()
51
            ->end()
52
            ;
53
54
        return $tb;
55
    }
56
}
57