Passed
Push — master ( 70e83c...1c3e17 )
by Guilherme
01:08 queued 10s
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 55
dl 0
loc 64
ccs 54
cts 54
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 59 1
1
<?php
2
3
namespace PROCERGS\LoginCidadao\NfgBundle\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 4
    public function getConfigTreeBuilder()
19
    {
20 4
        $treeBuilder = new TreeBuilder();
21 4
        $rootNode = $treeBuilder->root('procergs_nfg');
22
23
        $rootNode
24 4
            ->children()
25 4
                ->booleanNode('verify_https')
26 4
                    ->info('When false, errors such as invalid TLS certificates will be ignored')
27 4
                    ->defaultTrue()
28 4
                ->end()
29 4
                ->arrayNode('circuit_breaker')
30 4
                    ->addDefaultsIfNotSet()
31 4
                    ->children()
32 4
                        ->integerNode('max_failures')
33 4
                            ->min(1)
34 4
                            ->defaultValue(2)
35 4
                        ->end()
36 4
                        ->integerNode('reset_timeout')
37 4
                            ->min(1)
38 4
                            ->defaultValue(30)
39 4
                        ->end()
40 4
                    ->end()
41 4
                ->end()
42 4
                ->arrayNode('endpoints')
43 4
                    ->isRequired()
44 4
                    ->children()
45 4
                        ->scalarNode('wsdl')
46 4
                            ->isRequired()
47 4
                        ->end()
48 4
                        ->scalarNode('login')
49 4
                            ->isRequired()
50 4
                        ->end()
51 4
                        ->scalarNode('authorization')
52 4
                            ->isRequired()
53 4
                        ->end()
54 4
                    ->end()
55 4
                ->end()
56 4
                ->arrayNode('authentication')
57 4
                    ->isRequired()
58 4
                    ->children()
59 4
                        ->scalarNode('organization')
60 4
                            ->isRequired()
61 4
                        ->end()
62 4
                        ->scalarNode('username')
63 4
                            ->isRequired()
64 4
                        ->end()
65 4
                        ->scalarNode('password')
66 4
                            ->isRequired()
67 4
                        ->end()
68 4
                        ->scalarNode('hmac_secret')
69 4
                            ->isRequired()
70 4
                        ->end()
71 4
                    ->end()
72 4
                ->end()
73 4
            ->end()
74
        ;
75
76 4
        return $treeBuilder;
77
    }
78
}
79