Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 12
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 17
rs 9.8666
1
<?php
2
3
/**
4
 * This file is part of the bugloos/fault-tolerance-bundle project.
5
 * (c) Bugloos <https://bugloos.com/>
6
 * For the full copyright and license information, please view
7
 * the LICENSE file that was distributed with this source code.
8
 */
9
10
namespace Bugloos\FaultToleranceBundle\DependencyInjection;
11
12
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
13
use Symfony\Component\Config\Definition\ConfigurationInterface;
14
15
/**
16
 * @author Mojtaba Gheytasi <[email protected]>
17
 */
18
class Configuration implements ConfigurationInterface
19
{
20
    public function getConfigTreeBuilder(): TreeBuilder
21
    {
22
        $treeBuilder = new TreeBuilder('bugloos_fault_tolerance');
23
24
        $rootNode = $treeBuilder->getRootNode();
25
26
        $rootNode
27
            ->children()
28
                ->scalarNode('redis_url')
29
                    ->defaultValue('')
30
                ->end()
31
                ->scalarNode('mongodb_url')
32
                    ->defaultValue('')
33
                ->end()
34
            ->end();
35
36
        return $treeBuilder;
37
    }
38
}
39