Completed
Push — master ( db9f4a...505dbe )
by Alexis
02:20
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 30
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 30
rs 8.8571
cc 1
eloc 20
nc 1
nop 0
1
<?php
2
3
namespace Alpixel\Bundle\ElasticaQuerySorterBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * This is the class that validates and merges configuration from your app/config files
10
 *
11
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function getConfigTreeBuilder()
19
    {
20
        $treeBuilder = new TreeBuilder();
21
        $rootNode = $treeBuilder->root('alpixel_elastica_query_sorter');
22
23
        $rootNode
24
            ->children()
25
                ->arrayNode('views')
26
                    ->children()
27
                        ->scalarNode('clear_sort')
28
                            ->defaultvalue('AlpixelElasticaQuerySorterBundle:blocks:clear_sort.html.twig')
29
                        ->end()
30
                        ->scalarNode('sort_link')
31
                            ->defaultvalue('AlpixelElasticaQuerySorterBundle:blocks:sort_link.html.twig')
32
                        ->end()
33
                    ->end()
34
                ->end()
35
                ->scalarNode('item_per_page')
36
                    ->defaultvalue(25)
37
                ->end()
38
            ->end()
39
        ;
40
41
42
        // Here you should define the parameters that are allowed to
43
        // configure your bundle. See the documentation linked above for
44
        // more information on that topic.
45
46
        return $treeBuilder;
47
    }
48
}
49