Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
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 28
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 20 1
1
<?php
2
3
namespace Sleepness\UberTranslationBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * Respond for building configuration of bundle
10
 *
11
 * @author Viktor Novikov <[email protected]>
12
 * @author Alexandr Zhulev <[email protected]>
13
 */
14
class Configuration implements ConfigurationInterface
15
{
16
    /**
17
     * Generate the configuration tree.
18
     *
19
     * @return TreeBuilder
20
     */
21
    public function getConfigTreeBuilder()
22
    {
23
        $treeBuilder = new TreeBuilder();
24
        $rootNode = $treeBuilder->root('sleepness_uber_translation');
25
        $rootNode
26
            ->children()
27
                ->arrayNode('memcached')
28
                    ->children()
29
                        ->scalarNode('host')->end()
30
                        ->integerNode('port')->end()
31
                    ->end()
32
                ->end()
33
                ->arrayNode('supported_locales')
34
                    ->defaultValue(array('en'))
35
                    ->prototype('scalar')
36
                ->end()
37
        ;
38
39
        return $treeBuilder;
40
    }
41
}
42