Completed
Push — master ( c091a3...52a46f )
by Petrică
02:24
created

ConfigDefinition   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

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 0
cts 16
cp 0
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
    public function getConfigTreeBuilder()
25
    {
26
        $treeBuilder = new TreeBuilder();
27
        $rootNode = $treeBuilder->root('gauges');
28
        $rootNode
29
            ->useAttributeAsKey('path')
30
            ->prototype('array')
31
            ->children()
32
                ->scalarNode('class')
33
                    ->isRequired()
34
                    ->cannotBeEmpty()
35
                ->end()
36
                ->variableNode('arguments')->end()
37
            ->end();
38
39
        return $treeBuilder;
40
    }
41
}
42