ListUserRequestConfiguration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 34 1
1
<?php
2
namespace OmnideskBundle\Configuration\User;
3
4
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
5
use Symfony\Component\Config\Definition\ConfigurationInterface;
6
7
/**
8
 * Class ListUserRequestConfiguration
9
 * @package OmnideskBundle\Configuration\User
10
 */
11
class ListUserRequestConfiguration 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
                ->end()
40
                ->scalarNode('user_email')
41
                    ->defaultNull()
42
                ->end()
43
                ->scalarNode('user_phone')
44
                    ->defaultNull()
45
                ->end()
46
                ->integerNode('language_id')
47
                    ->defaultNull()
48
                ->end()
49
                ->arrayNode('custom_fields')
50
                    ->prototype('scalar')
51
                    ->end()
52
                ->end()
53
                ->booleanNode('amount_of_cases')
54
                    ->defaultFalse()
55
                ->end()
56
            ->end();
57
58
        return $treeBuilder;
59
    }
60
}
61