Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 16
ccs 10
cts 10
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 11
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Savchenko\Bundle\OpenWeatherMapBundle\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 1
    public function getConfigTreeBuilder()
17
    {
18 1
        $treeBuilder = new TreeBuilder();
19 1
        $rootNode = $treeBuilder->root('savchenko_open_weather_map');
20
21
        $rootNode
22 1
            ->children()
23 1
                ->scalarNode('api_key')
24 1
                    ->isRequired()
25 1
                    ->cannotBeEmpty()
26 1
                ->end()
27 1
            ->end()
28
        ;
29
30 1
        return $treeBuilder;
31
    }
32
}
33