Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 16
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 19
ccs 16
cts 16
cp 1
rs 9.7333
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace SymfonyBundles\RedisBundle\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
    /**
11
     * {@inheritdoc}
12
     */
13 7
    public function getConfigTreeBuilder(): TreeBuilder
14
    {
15 7
        $builder = new TreeBuilder('sb_redis');
16
        $builder
17 7
            ->getRootNode()
18 7
            ->children()
19 7
                ->arrayNode('clients')
20 7
                    ->addDefaultChildrenIfNoneSet('default')
21 7
                    ->useAttributeAsKey('default')
22 7
                    ->prototype('array')
23 7
                        ->children()
24 7
                            ->arrayNode('$parameters')->prototype('variable')->end()->end()
25 7
                            ->arrayNode('$options')->prototype('variable')->end()->end()
26 7
                        ->end()
27 7
                    ->end()
28 7
                ->end()
29 7
            ->end();
30
31 7
        return $builder;
32
    }
33
}
34