Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 14
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 19
ccs 14
cts 14
cp 1
rs 9.4285
cc 1
eloc 15
nc 1
nop 0
crap 1
1
<?php
2
3
namespace CrowdReactive\LobBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
final class Configuration implements ConfigurationInterface
9
{
10 3
    public function getConfigTreeBuilder()
11
    {
12 3
        $treeBuilder = new TreeBuilder();
13 3
        $root = $treeBuilder->root('crowd_reactive_lob', 'array');
14
15
        $root
16 3
            ->children()
17 3
                ->scalarNode('api_key')
18 3
                    ->isRequired()
19 3
                    ->cannotBeEmpty()
20 3
                    ->info('Lob.com API key')
21 3
                    ->end()
22 3
                ->scalarNode('version')
23 3
                    ->defaultNull()
24 3
                    ->info('Version of the Lob.com API to use (default is latest)')
25 3
                    ->end();
26
27 3
        return $treeBuilder;
28
    }
29
}
30