ListStaffRequestConfiguration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 36
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 20 1
1
<?php
2
namespace OmnideskBundle\Configuration\Staff;
3
4
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
5
use Symfony\Component\Config\Definition\ConfigurationInterface;
6
7
/**
8
 * Class ListStaffRequestConfiguration
9
 * @package OmnideskBundle\Configuration\Staff
10
 */
11
class ListStaffRequestConfiguration implements ConfigurationInterface
12
{
13
    /**
14
     * @var int
15
     */
16
    const DEFAULT_PAGE = 1;
17
18
    /**
19
     * @var int
20
     */
21
    const DEFAULT_LIMIT = 100;
22
23
    /**
24
     * @return TreeBuilder
25
     */
26
    public function getConfigTreeBuilder()
27
    {
28
        $treeBuilder = new TreeBuilder();
29
30
        $rootNode = $treeBuilder->root('params');
31
32
        $rootNode
33
            ->children()
34
                ->integerNode('page')
35
                    ->defaultValue(self::DEFAULT_PAGE)
36
                ->end()
37
                ->integerNode('limit')
38
                    ->defaultValue(self::DEFAULT_LIMIT)
39
                    ->min(1)
40
                    ->max(100)
41
                ->end()
42
            ->end();
43
44
        return $treeBuilder;
45
    }
46
}
47