Test Setup Failed
Push — master ( 11a9b9...e33cc1 )
by Vragov
13:07
created

getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 46
Code Lines 41

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 46
rs 8.9411
cc 1
eloc 41
nc 1
nop 0
1
<?php
2
namespace OmnideskBundle\Configuration\Cases;
3
4
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
5
use Symfony\Component\Config\Definition\ConfigurationInterface;
6
7
/**
8
 * Class AddCasesRequestConfiguration
9
 * @package OmnideskBundle\Configuration\Cases
10
 */
11
class AddCasesRequestConfiguration implements ConfigurationInterface
12
{
13
    /**
14
     * @return TreeBuilder
15
     */
16
    public function getConfigTreeBuilder()
17
    {
18
        $treeBuilder = new TreeBuilder();
19
20
        $rootNode = $treeBuilder->root('params');
21
22
        $rootNode
23
            ->children()
24
                ->scalarNode('user_email')
25
                    ->defaultNull()
26
                ->end()
27
                ->scalarNode('user_phone')
28
                    ->defaultNull()
29
                ->end()
30
                ->scalarNode('user_full_name')
31
                    ->defaultNull()
32
                ->end()
33
                ->scalarNode('subject')
34
                    ->isRequired()
35
                    ->cannotBeEmpty()
36
                ->end()
37
                ->scalarNode('content')
38
                    ->isRequired()
39
                    ->cannotBeEmpty()
40
                ->end()
41
                ->scalarNode('content_html')
42
                    ->isRequired()
43
                    ->cannotBeEmpty()
44
                ->end()
45
                ->scalarNode('group_id')
46
                    ->defaultNull()
47
                ->end()
48
                ->scalarNode('language_id')
49
                    ->defaultNull()
50
                ->end()
51
                ->arrayNode('custom_fields')
52
                ->end()
53
                ->arrayNode('labels')
54
                ->end()
55
                ->arrayNode('attachments')
56
                    ->prototype('scalar')
57
                ->end()
58
            ->end();
59
60
        return $treeBuilder;
61
    }
62
}
63