Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 38
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 32 1
1
<?php
2
3
namespace Devhelp\PiwikBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
class Configuration implements ConfigurationInterface
9
{
10
    /**
11
     * {@inheritDoc}
12
     */
13
    public function getConfigTreeBuilder()
14
    {
15
        $treeBuilder = new TreeBuilder();
16
        $rootNode = $treeBuilder->root('devhelp_piwik');
17
18
        $rootNode
19
            ->children()
20
                ->scalarNode('client')
21
                    ->info('service for making HTTP requests')
22
                    ->isRequired()
23
                    ->cannotBeEmpty()
24
                ->end()
25
                ->arrayNode('api')
26
                    ->isRequired()
27
                    ->requiresAtLeastOneElement()
28
                    ->prototype('array')
29
                        ->children()
30
                            ->scalarNode('url')
31
                                ->info('Piwik api url')
32
                                ->isRequired()
33
                            ->end()
34
                            ->variableNode('default_params')
35
                                ->info('default parameters which are going to be used in api call')
36
                                ->defaultValue([])
37
                            ->end()
38
                        ->end()
39
                    ->end()
40
                ->end()
41
            ->end();
42
43
        return $treeBuilder;
44
    }
45
}
46