Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 35
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 29 1
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
                ->booleanNode('disable_alias')
36
                    ->info('disables aliasing of Symfony router in case it is done somewhere else')
37
                    ->defaultFalse()
38
                ->end()
39
                ->integerNode('router_priority')
40
                    ->defaultValue(-100)
41
                    ->info('The priority with which the ONGR router is set to the chain router')
42
                ->end()
43
                ->scalarNode('manager')
44
                    ->defaultValue('es.manager.default')
45
                    ->info('Elasticsearch manager to use in the ONGR default router')
46
                    ->example('es.manager.default')
47
                ->end()
48
                ->arrayNode('seo_routes')
49
                    ->defaultValue([])
50
                    ->useAttributeAsKey('name')
51
                    ->prototype('scalar')->end()
52
                ->end()
53
            ->end();
54
55
        return $treeBuilder;
56
    }
57
}
58