Completed
Push — master ( f56ae9...d1d973 )
by Janusz
33:48 queued 16:16
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 23
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 28
ccs 23
cts 23
cp 1
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 23
nc 1
nop 0
crap 1
1
<?php
2
3
namespace FlyingColours\TwilioTwoFactorBundle\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 2
    public function getConfigTreeBuilder()
11
    {
12 2
        $treeBuilder = new TreeBuilder();
13 2
        $rootNode = $treeBuilder->root('flying_colours_twilio_two_factor');
14
15
        $rootNode
16 2
            ->children()
17 2
                ->scalarNode('form_template')->defaultValue('@SchebTwoFactor/Authentication/form.html.twig')->end()
18 2
                ->arrayNode('twilio')
19 2
                    ->addDefaultsIfNotSet()
20 2
                    ->children()
21 2
                        ->scalarNode('username')->defaultNull()->end()
22 2
                        ->scalarNode('password')->defaultNull()->end()
23 2
                    ->end()
24 2
                ->end()
25 2
                ->arrayNode('config')
26 2
                    ->addDefaultsIfNotSet()
27 2
                    ->children()
28 2
                        ->scalarNode('sms_from')->defaultNull()->end()
29 2
                        ->scalarNode('sms_message')->defaultValue('{code} is your code')->end()
30 2
                        ->scalarNode('voice_from')->defaultNull()->end()
31 2
                        ->scalarNode('voice_message_url')->defaultNull()->end()
32 2
                    ->end()
33 2
                ->end()
34 2
            ->end()
35
        ;
36
37 2
        return $treeBuilder;
38
    }
39
}
40