Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 16
ccs 11
cts 11
cp 1
rs 9.9
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the U2F Security bundle.
5
 *
6
 * (c) Michael Barbey <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Mbarbey\U2fSecurityBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
class Configuration implements ConfigurationInterface
18
{
19 3
    public function getConfigTreeBuilder()
20
    {
21 3
        $treeBuilder = new TreeBuilder();
22 3
        $rootNode = $treeBuilder->root('mbarbey_u2f_security');
23
24
        $rootNode
25 3
            ->children()
26 3
                ->scalarNode('authentication_route')
27 3
                    ->isRequired()
28 3
                    ->cannotBeEmpty()
29 3
                ->end()
30 3
                ->arrayNode('whitelist_routes')->scalarPrototype()->end()
31 3
            ->end()
32
        ;
33
34 3
        return $treeBuilder;
35
    }
36
}