Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 28
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 22 1
1
<?php
2
3
namespace TreeHouse\BaseApiBundle\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 24
    public function getConfigTreeBuilder()
14
    {
15 24
        $treeBuilder = new TreeBuilder();
16 24
        $rootNode = $treeBuilder->root('tree_house_base_api');
17
        $rootNode
18 24
            ->children()
19 24
                ->scalarNode('token_host')
20 24
                    ->isRequired()
21 24
                ->end()
22 24
                ->scalarNode('host')
23 24
                    ->isRequired()
24 24
                ->end()
25 24
                ->scalarNode('allowed_origins')
26 24
                    ->info('CORS: specifies which origins are allowed to access the api.')
27 24
                    ->example('http://example.org')
28 24
                    ->defaultValue('*')
29 24
                ->end()
30 24
            ->end()
31
        ;
32
33 24
        return $treeBuilder;
34
    }
35
}
36