Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 46
ccs 35
cts 35
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 40 1
1
<?php
2
3
namespace EmanueleMinotto\SafeBrowsingBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * {@inheritdoc}
10
 */
11
class Configuration implements ConfigurationInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 3
    public function getConfigTreeBuilder()
17
    {
18 3
        $treeBuilder = new TreeBuilder();
19 3
        $rootNode = $treeBuilder->root('safe_browsing');
20
21
        $rootNode
22 3
            ->children()
23 3
                ->arrayNode('configs')
24 3
                    ->children()
25 3
                        ->scalarNode('client')
26 3
                            ->defaultValue('app')
27 3
                            ->info('The client name')
28 3
                        ->end()
29 3
                        ->scalarNode('appver')
30 3
                            ->defaultValue('1.0.0')
31 3
                            ->info('The version of the client')
32 3
                        ->end()
33 3
                        ->scalarNode('key')
34 3
                            ->info('API key')
35 3
                            ->isRequired()
36 3
                        ->end()
37 3
                        ->enumNode('pver')
38 3
                            ->defaultValue(3.1)
39 3
                            ->info('The protocol version supported')
40 3
                            ->values([3.0, 3.1])
41 3
                        ->end()
42 3
                    ->end()
43 3
                ->end()
44 3
                ->scalarNode('cache')
45 3
                    ->defaultNull()
46 3
                    ->info('Caching service')
47 3
                ->end()
48 3
                ->scalarNode('http_client')
49 3
                    ->defaultNull()
50 3
                    ->info('HTTP client service')
51 3
                ->end()
52 3
            ->end();
53
54 3
        return $treeBuilder;
55
    }
56
}
57