Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 16
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 21
ccs 16
cts 16
cp 1
rs 9.3143
cc 1
eloc 17
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Innmind\RestBundle\DependencyInjection;
4
5
use Innmind\Rest\Server\Configuration as ServerConfiguration;
6
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
7
use Symfony\Component\Config\Definition\ConfigurationInterface;
8
9
class Configuration implements ConfigurationInterface
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14 24
    public function getConfigTreeBuilder()
15
    {
16 24
        $server = new ServerConfiguration;
17 24
        $treeBuilder = new TreeBuilder;
18 24
        $root = $treeBuilder->root('innmind_rest');
19
20
        $root
21 24
            ->children()
22 24
                ->arrayNode('server')
23 24
                    ->append($server->getCollectionNode())
24 24
                    ->children()
25 24
                        ->scalarNode('prefix')
26 24
                            ->info('Prefix for all routes of the API')
27 24
                            ->defaultValue(null)
28 24
                        ->end()
29 24
                    ->end()
30 24
                ->end()
31 24
            ->end();
32
33 24
        return $treeBuilder;
34
    }
35
}
36