Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 46 1
1
<?php
2
3
namespace Bgy\OAuth2ServerBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * This is the class that validates and merges configuration from your app/config files
10
 *
11
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function getConfigTreeBuilder()
19
    {
20
        $treeBuilder = new TreeBuilder();
21
        $rootNode = $treeBuilder->root('bgy_o_auth2_server');
22
23
        $rootNode
24
            ->children()
25
                ->arrayNode('authorization_server')
26
                    ->children()
27
                        ->arrayNode('storage')
28
                            ->children()
29
                                ->scalarNode('access_token')
30
                                ->end()
31
                                ->scalarNode('refresh_token')
32
                                ->end()
33
                                ->scalarNode('client')
34
                                ->end()
35
                            ->end()
36
                        ->end()
37
                        ->scalarNode('token_generator')->end()
38
                        ->booleanNode('always_generate_a_refresh_token')
39
                            ->defaultTrue()
40
                        ->end()
41
                        ->booleanNode('always_require_a_client')
42
                            ->defaultTrue()
43
                        ->end()
44
                        ->integerNode('access_token_ttl')
45
                            ->defaultValue(3600)
46
                        ->end()
47
                        ->integerNode('refresh_token_ttl')
48
                            ->defaultValue(3600)
49
                        ->end()
50
                        ->booleanNode('revoke_refresh_token_when_used')
51
                            ->defaultFalse()
52
                        ->end()
53
                        ->arrayNode('grant_types')
54
                            ->prototype('scalar')->end()
55
                        ->end()
56
                    ->end()
57
                ->end()
58
            ->end()
59
        ;
60
61
62
        return $treeBuilder;
63
    }
64
}
65