Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 29
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 23
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 23
c 1
b 0
f 0
dl 0
loc 29
ccs 23
cts 23
cp 1
rs 9.552
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace drupol\CasBundle\DependencyInjection;
6
7
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
8
use Symfony\Component\Config\Definition\ConfigurationInterface;
9
10
/**
11
 * Class Configuration.
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18 2
    public function getConfigTreeBuilder()
19
    {
20 2
        $treeBuilder = new TreeBuilder('cas');
21
22
        /** @var \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $rootNode */
23 2
        $rootNode = $treeBuilder->getRootNode();
24
25
        $rootNode
26 2
            ->children()
27 2
            ->scalarNode('base_url')->defaultValue('')->end()
28 2
            ->arrayNode('protocol')
0 ignored issues
show
Bug introduced by
The method arrayNode() does not exist on Symfony\Component\Config...der\NodeParentInterface. It seems like you code against a sub-type of Symfony\Component\Config...der\NodeParentInterface such as Symfony\Component\Config...ion\Builder\NodeBuilder. ( Ignorable by Annotation )

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

28
            ->/** @scrutinizer ignore-call */ arrayNode('protocol')
Loading history...
29 2
            ->useAttributeAsKey('name')
30 2
            ->arrayPrototype()
31 2
            ->children()
32 2
            ->scalarNode('path')
33 2
            ->isRequired()
34 2
            ->cannotBeEmpty()
35 2
            ->end()
36 2
            ->arrayNode('allowed_parameters')
37 2
            ->defaultValue([])
38 2
            ->scalarPrototype()->end()
39 2
            ->end()
40 2
            ->arrayNode('default_parameters')
41 2
            ->defaultValue([])
42 2
            ->scalarPrototype()->end()
43 2
            ->end()
44 2
            ->end();
45
46 2
        return $treeBuilder;
47
    }
48
}
49