Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
cc 1
eloc 13
c 3
b 1
f 0
nc 1
nop 0
dl 0
loc 16
rs 9.8333
1
<?php
2
/*
3
 * This file is part of the Guarded Authentication package.
4
 *
5
 * (c) Jafar Jabr <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Jafar\Bundle\GuardedAuthenticationBundle\DependencyInjection;
12
13
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
14
use Symfony\Component\Config\Definition\ConfigurationInterface;
15
16
/**
17
 * Class Configuration.
18
 *
19
 * @author Jafar Jabr <[email protected]>
20
 */
21
class Configuration implements ConfigurationInterface
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function getConfigTreeBuilder()
27
    {
28
        $treeBuilder = new TreeBuilder('jafar_guarded_authentication');
29
        $rootNode    = $treeBuilder->getRootNode();
30
        $rootNode
31
            ->children()
32
            ->scalarNode('pass_phrase')->end()
33
            ->scalarNode('token_ttl')->end()
34
            ->scalarNode('login_route')->end()
35
            ->scalarNode('home_page_route')->end()
36
            ->scalarNode('api_login_route')->end()
37
            ->scalarNode('api_home_page_route')->end()
38
            ->scalarNode('refresh_ttl')->end()
39
            ->end();
40
41
        return $treeBuilder;
42
    }
43
}
44