ConfigDefinition   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 25
ccs 14
cts 14
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 17 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Petrica
5
 * Date: 3/26/2016
6
 * Time: 1:25
7
 */
8
namespace Petrica\StatsdSystem\Config\Definition;
9
10
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
11
use Symfony\Component\Config\Definition\ConfigurationInterface;
12
13
/**
14
 * Class ConfigDefinition
15
 * @package Petrica\StatsdSystem\Config\Definition
16
 */
17
class ConfigDefinition implements ConfigurationInterface
18
{
19
    /**
20
     * Provides configuration mapping
21
     *
22
     * @return TreeBuilder
23
     */
24 1
    public function getConfigTreeBuilder()
25
    {
26 1
        $treeBuilder = new TreeBuilder();
27 1
        $rootNode = $treeBuilder->root('gauges');
28
        $rootNode
29 1
            ->useAttributeAsKey('path')
30 1
            ->prototype('array')
31 1
            ->children()
32 1
                ->scalarNode('class')
33 1
                    ->isRequired()
34 1
                    ->cannotBeEmpty()
35 1
                ->end()
36 1
                ->variableNode('arguments')->end()
37 1
            ->end();
38
39 1
        return $treeBuilder;
40 1
    }
41
}
42