Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 22
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 26 1
1
<?php
2
3
/**
4
 * This file is part of the bugloos/responder-bundle project.
5
 * (c) Bugloos <https://bugloos.com/>
6
 * For the full copyright and license information, please view
7
 * the LICENSE file that was distributed with this source code.
8
 */
9
10
namespace Bugloos\ResponderBundle\DependencyInjection;
11
12
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
13
use Symfony\Component\Config\Definition\ConfigurationInterface;
14
15
/**
16
 * @author Mojtaba Gheytasi <[email protected]>
17
 */
18
class Configuration implements ConfigurationInterface
19
{
20
    public function getConfigTreeBuilder(): TreeBuilder
21
    {
22
        $treeBuilder = new TreeBuilder('bugloos_responder');
23
24
        $rootNode = $treeBuilder->getRootNode();
25
26
        $rootNode
27
            ->children()
28
                ->scalarNode('default_max_items_per_page')
29
                    ->defaultValue(100)
30
                ->end()
31
                ->scalarNode('default_items_per_page')
32
                    ->defaultValue(20)
33
                ->end()
34
                ->scalarNode('page_key_in_request')
35
                    ->defaultValue('page')
36
                ->end()
37
                ->scalarNode('items_per_page_key_in_request')
38
                    ->defaultValue('itemsPerPage')
39
                ->end()
40
                ->scalarNode('paginator_response')
41
                    ->defaultValue('Bugloos\ResponderBundle\Service\DefaultPaginatorResponse')
42
                ->end()
43
            ->end();
44
45
        return $treeBuilder;
46
    }
47
}
48