Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 1
c 2
b 0
f 2
lcom 0
cbo 4
dl 0
loc 27
ccs 16
cts 16
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 21 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