Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 20
rs 9.4285
cc 1
eloc 16
nc 1
nop 0
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