Test Failed
Push — develop ( 0f3a91...656ecc )
by Janusz
06:59 queued 01:19
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 23
nc 1
nop 0
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