Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 15
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 15
cts 15
cp 1
rs 9.3142
c 0
b 0
f 0
cc 1
eloc 16
nc 1
nop 0
crap 1
1
<?php
2
3
namespace GBProd\ElasticaExtraBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * Configuration
10
 *
11
 * @author gbprod <[email protected]>
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18 13
    public function getConfigTreeBuilder()
19
    {
20 13
        $treeBuilder = new TreeBuilder();
21 13
        $rootNode = $treeBuilder->root('elastica_extra_bundle');
22
23
        $rootNode
24 13
            ->children()
25 13
                ->scalarNode('default_client')
26 13
                    ->defaultValue(null)
27 13
                ->end()
28 13
                ->arrayNode('indices')
29 13
                    ->defaultValue([])
30 13
                    ->prototype('array')
31 13
                        ->prototype('variable')->end()
32 13
                    ->end()
33 13
                ->end()
34 13
            ->end()
35
        ;
36
37 13
        return $treeBuilder;
38
    }
39
}
40
41