Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 18
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 23
ccs 18
cts 18
cp 1
rs 9.0856
cc 1
eloc 19
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Speicher210\FastbillBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * Bundle configuration.
10
 */
11
class Configuration implements ConfigurationInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 3
    public function getConfigTreeBuilder()
17
    {
18 3
        $treeBuilder = new TreeBuilder();
19 3
        $rootNode = $treeBuilder->root('speicher210_fastbill');
20
21
        $rootNode
22 3
            ->children()
23 3
                ->scalarNode('username')
24 3
                    ->isRequired()
25 3
                    ->cannotBeEmpty()
26 3
                ->end()
27 3
                ->scalarNode('api_key')
28 3
                    ->isRequired()
29 3
                    ->cannotBeEmpty()
30 3
                ->end()
31 3
                ->scalarNode('account_hash')
32 3
                    ->cannotBeEmpty()
33 3
                    ->defaultNull()
34 3
                ->end()
35 3
            ->end();
36
37 3
        return $treeBuilder;
38
    }
39
}
40