Completed
Push — master ( 4212e1...024960 )
by Simonas
22:08
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 7
Bugs 0 Features 1
Metric Value
c 7
b 0
f 1
dl 0
loc 20
rs 9.4286
cc 1
eloc 16
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ONGR\RouterBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * This is the class that validates and merges configuration from your app/config files.
19
 *
20
 * To learn more see
21
 *      {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
22
 */
23
class Configuration implements ConfigurationInterface
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function getConfigTreeBuilder()
29
    {
30
        $treeBuilder = new TreeBuilder();
31
        $rootNode = $treeBuilder->root('ongr_router');
32
33
        $rootNode
34
            ->children()
35
                ->scalarNode('manager')
36
                    ->defaultValue('es.manager.default')
37
                    ->info('Elasticsearch manager to use in the ONGR default router')
38
                    ->example('es.manager.default')
39
                ->end()
40
                ->arrayNode('seo_routes')
41
                    ->defaultValue([])
42
                    ->prototype('scalar')->end()
43
                ->end()
44
            ->end();
45
46
        return $treeBuilder;
47
    }
48
}
49