Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 14
Bugs 0 Features 3
Metric Value
wmc 1
c 14
b 0
f 3
lcom 0
cbo 4
dl 0
loc 45
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 39 1
1
<?php
2
3
namespace DoS\UserBundle\DependencyInjection;
4
5
use DoS\ResourceBundle\DependencyInjection\AbstractResourceConfiguration;
6
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
7
8
class Configuration extends AbstractResourceConfiguration
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function getConfigTreeBuilder()
14
    {
15
        $treeBuilder = new TreeBuilder();
16
17
        $this->setDefaults($node = $treeBuilder->root('dos_user'), array(
18
            'resources' => array(
19
                'otp' => array(
20
                    'classes' => array(
21
                        'model' => 'DoS\UserBundle\Model\OneTimePassword',
22
                        'interface' => 'DoS\UserBundle\Model\OneTimePasswordInterface',
23
                    ),
24
                    'validation_groups' => array(
25
                        'default' => array('dos'),
26
                    ),
27
                ),
28
            ),
29
        ));
30
31
        $node
32
            ->children()
33
                ->arrayNode('confirmation')
34
                    ->addDefaultsIfNotSet()
35
                    ->children()
36
                        ->scalarNode('actived')
37
                            ->defaultNull()
38
                            ->cannotBeEmpty()
39
                        ->end()
40
41
                        ->arrayNode('types')
42
                            ->useAttributeAsKey('name')
43
                            ->prototype('variable')
44
                        ->end()
45
                    ->end()
46
                ->end()
47
            ->end()
48
        ;
49
50
        return $treeBuilder;
51
    }
52
}
53