Completed
Branch develop (656ecc)
by Janusz
10:43 queued 06:18
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 30
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 28 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
    public function getConfigTreeBuilder()
11
    {
12
        $treeBuilder = new TreeBuilder();
13
        $rootNode = $treeBuilder->root('flying_colours_twilio_two_factor');
14
15
        $rootNode
16
            ->children()
17
                ->scalarNode('form_template')->defaultValue('@SchebTwoFactor/Authentication/form.html.twig')->end()
18
                ->arrayNode('twilio')
19
                    ->addDefaultsIfNotSet()
20
                    ->children()
21
                        ->scalarNode('username')->defaultNull()->end()
22
                        ->scalarNode('password')->defaultNull()->end()
23
                    ->end()
24
                ->end()
25
                ->arrayNode('config')
26
                    ->addDefaultsIfNotSet()
27
                    ->children()
28
                        ->scalarNode('sms_from')->defaultNull()->end()
29
                        ->scalarNode('sms_message')->defaultValue('{code} is your code')->end()
30
                        ->scalarNode('voice_from')->defaultNull()->end()
31
                        ->scalarNode('voice_message_url')->defaultNull()->end()
32
                    ->end()
33
                ->end()
34
            ->end()
35
        ;
36
37
        return $treeBuilder;
38
    }
39
}
40