Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 9
cts 9
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Pgs\ElasticOM\Bridge\Symfony;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
class Configuration implements ConfigurationInterface
9
{
10 1
    public function getConfigTreeBuilder(): TreeBuilder
11
    {
12 1
        $treeBuilder = new TreeBuilder();
13 1
        $rootNode = $treeBuilder->root('elastic_om');
14
15
        $rootNode
16 1
            ->children()
17 1
                ->scalarNode('host')->defaultValue('localhost')->end()
18 1
                ->scalarNode('port')->defaultValue(9200)->end()
19 1
                ->scalarNode('index')->defaultValue('elastic_om')->end()
20 1
            ->end();
21
22 1
        return $treeBuilder;
23
    }
24
}
25