Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 76 1
1
<?php
2
3
namespace SkautisBundle\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
    public function getConfigTreeBuilder()
14
    {
15
        $treeBuilder = new TreeBuilder();
16
        $rootNode = $treeBuilder->root('skautis');
17
18
        $rootNode->children()
19
            ->scalarNode('app_id')
20
            ->isRequired()
21
            ->info("Skautis app id")
22
            ->end()
23
            ->booleanNode('test_mode')
24
            ->defaultValue(true)
25
            ->isRequired()
26
            ->info("Use test-is.skaut.cz")
27
            ->end()
28
            ->booleanNode('profiler')
29
            ->defaultValue('%kernel.debug%')
30
            ->info("Gather data for profiler")
31
            ->end()
32
            ->booleanNode('wsdl_compression')
33
            ->defaultValue(true)
34
            ->info("Enable WSDL compression")
35
            ->end()
36
            ->booleanNode('wsdl_cache')
37
            ->defaultValue(false)
38
            ->info("Enable wsdl cache")
39
            ->end()
40
            ->scalarNode('doctrine_cache_provider')
41
            ->defaultValue('')
42
            ->info("Doctrine cache provider")
43
            ->end()
44
            ->booleanNode('request_cache')
45
            ->defaultValue(false)
46
            ->info("Use request cache")
47
            ->end()
48
            ->integerNode('request_cache_ttl')
49
            ->defaultValue(0)
50
            ->info("Request cache time to live")
51
            ->end()
52
            ->scalarNode('after_login_redirect')
53
            ->defaultValue('homepage')
54
            ->info("Route to be redirected to after login")
55
            ->end()
56
            ->scalarNode('after_logout_redirect')
57
            ->defaultValue('homepage')
58
            ->info("Route to be redirected to after logout")
59
            ->end()
60
            ->arrayNode("auth")->children()
61
            ->booleanNode("enable_connector")
62
            ->info("Enable connecting users from Skautis to Users in application")
63
            ->defaultValue(false)
64
            ->end()
65
            ->scalarNode('connector_service')
66
            ->defaultValue('')
67
            ->info("Name of service implementing UserConnectorInterface")
68
            ->end()
69
            ->booleanNode("enable_autoregister")
70
            ->defaultValue(false)
71
            ->info("Enable automatic registering of users from SkautIS")
72
            ->end()
73
            ->scalarNode('registrator_service')
74
            ->defaultValue('')
75
            ->info("Name of service implementing UserRegistratorInterface")
76
            ->end()
77
            ->booleanNode("enable_skautis_anonymous")
78
            ->defaultValue(false)
79
            ->info("Login users to Symfony who has account at Skautis only")
80
            ->end()
81
            ->booleanNode("force_confirm_auth")
82
            ->defaultValue(true)
83
            ->info("Verify login via request to SkautIS server on each access")
84
            ->end()
85
            ->end();
86
87
        return $treeBuilder;
88
    }
89
}
90