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 0
Metric Value
cc 1
eloc 23
nc 1
nop 0
dl 0
loc 29
ccs 23
cts 23
cp 1
crap 1
rs 9.552
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * For the full copyright and license information, please view
5
 * the LICENSE file that was distributed with this source code.
6
 *
7
 * @see https://github.com/ecphp
8
 */
9
10
declare(strict_types=1);
11
12
namespace EcPhp\CasBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
final class Configuration implements ConfigurationInterface
18
{
19 1
    public function getConfigTreeBuilder(): TreeBuilder
20
    {
21 1
        $treeBuilder = new TreeBuilder('cas');
22
23
        /** @var \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $rootNode */
24 1
        $rootNode = $treeBuilder->getRootNode();
25
26
        $rootNode
27 1
            ->children()
28 1
            ->scalarNode('base_url')->defaultValue('')->end()
29 1
            ->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

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