Configuration::getConfigTreeBuilder()   A
last analyzed

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 1
Bugs 0 Features 1
Metric Value
eloc 23
c 1
b 0
f 1
dl 0
loc 28
ccs 23
cts 23
cp 1
rs 9.552
cc 1
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');
0 ignored issues
show
Deprecated Code introduced by
The function Symfony\Component\Config...der\TreeBuilder::root() has been deprecated: since Symfony 4.3, pass the root name to the constructor instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

13
        $rootNode = /** @scrutinizer ignore-deprecated */ $treeBuilder->root('flying_colours_twilio_two_factor');

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
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