Completed
Push — master ( 103460...224772 )
by GBProd
02:10
created

Configuration::getConfigTreeBuilder()   A

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 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 21
ccs 15
cts 15
cp 1
rs 9.3142
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 10
    public function getConfigTreeBuilder()
19
    {
20 10
        $treeBuilder = new TreeBuilder();
21 10
        $rootNode = $treeBuilder->root('elasticsearch_extra_bundle');
22
23
        $rootNode
24 10
            ->children()
25 10
                ->scalarNode('default_client')
26 10
                    ->defaultValue(null)
27 10
                ->end()
28 10
                ->arrayNode('indices')
29 10
                    ->defaultValue([])
30 10
                    ->prototype('array')
31 10
                        ->prototype('variable')->end()
32 10
                    ->end()
33 10
                ->end()
34 10
            ->end()
35
        ;
36
37 10
        return $treeBuilder;
38
    }
39
}
40
41