Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 9.552
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * @author Philip Washington Sorst <[email protected]>
10
 */
11
class Configuration implements ConfigurationInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function getConfigTreeBuilder()
17
    {
18
        $treeBuilder = new TreeBuilder('ddr_gitki_app');
19
        $rootNode = $treeBuilder->getRootNode();
20
21
        // @formatter:off
22
        $rootNode->children()
23
                ->scalarNode('display_name')->end()
24
                ->scalarNode('repository_path')->end()
25
                ->scalarNode('database_url')->end()
26
                ->arrayNode('elasticsearch')
27
                    ->children()
28
                        ->booleanNode('enabled')->end()
29
                        ->scalarNode('index_name')->end()
30
                        ->scalarNode('host')->end()
31
                        ->integerNode('port')->end()
32
                    ->end()
33
                ->end()
34
        ->end();
35
        // @formatter:on
36
37
        return $treeBuilder;
38
    }
39
}
40