Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
c 2
b 0
f 1
lcom 0
cbo 3
dl 0
loc 32
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 26 1
1
<?php
2
3
/*
4
 * This file is part of the NatsBundle package.
5
 *
6
 * (c) Issel Guberna <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Octante\NatsBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
class Configuration implements ConfigurationInterface
18
{
19
    /**
20
     * @return TreeBuilder
21
     */
22
    public function getConfigTreeBuilder()
23
    {
24
        $treeBuilder = new TreeBuilder();
25
        $rootNode = $treeBuilder->root('octante_nats');
26
27
        $rootNode
28
            ->children()
29
                ->arrayNode('connections')
30
                    ->prototype('array')
31
                        ->children()
32
                            ->scalarNode('host')->defaultValue('localhost')->end()
33
                            ->integerNode('port')->defaultValue(4222)->end()
34
                            ->scalarNode('user')->end()
35
                            ->scalarNode('password')->end()
36
                            ->booleanNode('verbose')->defaultFalse()->end()
37
                            ->booleanNode('reconnect')->defaultTrue()->end()
38
                            ->scalarNode('version')->end()
39
                            ->booleanNode('pedantic')->defaultFalse()->end()
40
                            ->scalarNode('lang')->defaultValue('php')->end()
41
                        ->end()
42
                    ->end()
43
                ->end()
44
            ->end();
45
46
        return $treeBuilder;
47
    }
48
}
49