Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 19
c 1
b 0
f 0
dl 0
loc 25
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 23 1
1
<?php
2
3
/**
4
 * This file is part of the bugloos/api-versioning-bundle project.
5
 * (c) Bugloos <https://bugloos.com/>
6
 * For the full copyright and license information, please view
7
 * the LICENSE file that was distributed with this source code.
8
 */
9
10
namespace Bugloos\ApiVersioningBundle\DependencyInjection;
11
12
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
13
use Symfony\Component\Config\Definition\ConfigurationInterface;
14
15
/**
16
 * @author Mojtaba Gheytasi <[email protected]>
17
 */
18
class Configuration implements ConfigurationInterface
19
{
20
    public function getConfigTreeBuilder(): TreeBuilder
21
    {
22
        $treeBuilder = new TreeBuilder('bugloos_api_versioning');
23
24
        $rootNode = $treeBuilder->getRootNode();
25
26
        $rootNode
27
            ->children()
28
                ->scalarNode('base_version')
29
                    ->defaultValue('v1.0')
30
                ->end()
31
                ->arrayNode('next_versions')
32
                    ->scalarPrototype()
33
                    ->end()
34
                ->defaultValue([])
35
                ->end()
36
                ->arrayNode('deleted_routes')
37
                    ->variablePrototype()
38
                    ->end()
39
                ->defaultValue([])
40
            ->end();
41
42
        return $treeBuilder;
43
    }
44
}
45