Completed
Push — master ( a36c27...010ee5 )
by GBProd
02:47
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 19
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 25
ccs 19
cts 19
cp 1
rs 8.8571
cc 1
eloc 20
nc 1
nop 0
crap 1
1
<?php
2
3
namespace GBProd\ElasticsearchExtraBundle\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
    public function getConfigTreeBuilder()
19
    {
20 1
        $treeBuilder = new TreeBuilder();
21 1
        $rootNode = $treeBuilder->root('elasticsearch_extra_bundle');
22
23
        $rootNode
24 1
            ->children()
25 1
                ->arrayNode('clients')
26 1
                    ->useAttributeAsKey('id')
27 1
                    ->prototype('array')
28 1
                        ->children()
29 1
                            ->arrayNode('indices')
30 1
                                ->defaultValue([])
31 1
                                ->prototype('array')
32 1
                                    ->prototype('variable')->end()
33 1
                                ->end()
34 1
                            ->end()
35 1
                        ->end()
36 1
                    ->end()
37 1
                ->end()
38 1
            ->end()
39
        ;
40 1
41 1
        return $treeBuilder;
42
    }
43
}
44