Configuration::getConfigTreeBuilder()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 21
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 8.8571
c 0
b 0
f 0
ccs 21
cts 21
cp 1
cc 1
eloc 22
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Lug package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Lug\Bundle\StorageBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class Configuration implements ConfigurationInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25 6
    public function getConfigTreeBuilder()
26
    {
27 6
        $treeBuilder = new TreeBuilder();
28
        $treeBuilder
29 6
            ->root('lug_storage')
30 6
            ->children()
31 6
                ->arrayNode('cookie')
32 6
                    ->canBeEnabled()
33 6
                ->end()
34 6
                ->arrayNode('doctrine')
35 6
                    ->canBeEnabled()
36 6
                    ->children()
37 6
                        ->scalarNode('service')
38 6
                            ->isRequired()
39 6
                            ->cannotBeEmpty()
40 6
                        ->end()
41 6
                    ->end()
42 6
                ->end()
43 6
                ->arrayNode('session')
44 6
                    ->canBeEnabled()
45 6
                ->end()
46 6
            ->end();
47
48 6
        return $treeBuilder;
49
    }
50
}
51