Completed
Push — feature/evo-2472-whoami ( aca89f...28fd37 )
by Jan
21:32 queued 10:36
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 35
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 17 1
1
<?php
2
/**
3
 * Configuration definition to be able to define every shown endpoint on the graviton main page.
4
 */
5
namespace Graviton\CoreBundle\DependencyInjection;
6
7
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
8
use Symfony\Component\Config\Definition\ConfigurationInterface;
9
10
/**
11
 * Class Configuration
12
 *
13
 * To learn more see {@link http://scm.to/00Yb}
14
 *
15
 * @author  List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
16
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
17
 * @link    http://swisscom.ch
18
 */
19
class Configuration implements ConfigurationInterface
20
{
21
    /**
22
     * Defines the structure of the configuration information.
23
     *
24
     * Example structure to be used in /app/config/config.yml:
25
     *
26
     *   graviton_core:
27
     *       service_name:
28
     *           - "graviton.service.first.example"
29
     *           - "graviton.service.second.example"
30
     *       uri_whitelist:
31
     *           - "/path/to/first/"
32
     *           - "/path/to/second/"
33
     *
34
     * @return TreeBuilder
35
     */
36
    public function getConfigTreeBuilder()
37
    {
38
        $treeBuilder = new TreeBuilder();
39
        $rootNode = $treeBuilder->root('graviton_core');
40
41
        $rootNode
42
            ->children()
43
                ->arrayNode('service_name')
44
                    ->prototype('scalar')->end()
45
                ->end()
46
                ->arrayNode('uri_whitelist')
47
                    ->prototype('scalar')->end()
48
                ->end()
49
            ->end();
50
51
        return $treeBuilder;
52
    }
53
}