Completed
Push — standalone ( fe4753...a7b79f )
by Philip
03:48
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 29
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 23
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 29
ccs 23
cts 23
cp 1
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 23
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Dontdrinkandroot\RestBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
class Configuration implements ConfigurationInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13 4
    public function getConfigTreeBuilder()
14
    {
15 4
        $treeBuilder = new TreeBuilder();
16 4
        $rootNode = $treeBuilder->root('ddr_rest');
17
18
        // @formatter:off
19 4
        $rootNode->children()
20 4
            ->scalarNode('access_token_class')->defaultNull()->end()
21 4
            ->scalarNode('authentication_provider_key')->defaultNull()->end()
22 4
            ->arrayNode('paths')
23 4
                ->prototype('scalar')->end()
24 4
            ->end()
25 4
            ->arrayNode('metadata')
26 4
                ->children()
27 4
                    ->arrayNode('directories')
28 4
                        ->prototype('array')
29 4
                            ->children()
30 4
                                ->scalarNode('path')->isRequired()->end()
31 4
                                ->scalarNode('namespace_prefix')->defaultValue('')->end()
32 4
                            ->end()
33 4
                        ->end()
34 4
                    ->end()
35 4
                ->end()
36 4
            ->end()
37 4
        ->end();
38
        // @formatter:on
39
40 4
        return $treeBuilder;
41
    }
42
}
43