Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 16 1
1
<?php
2
3
namespace Happyr\AutoFallbackTranslationBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * @author Tobias Nyholm <[email protected]>
10
 */
11
class Configuration implements ConfigurationInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function getConfigTreeBuilder()
17
    {
18
        $treeBuilder = new TreeBuilder();
19
        $root = $treeBuilder->root('happyr_auto_fallback_translation');
20
21
        $root->children()
22
            ->scalarNode('http_client')->cannotBeEmpty()->defaultValue('httplug.client')->end()
23
            ->scalarNode('message_factory')->cannotBeEmpty()->defaultValue('httplug.message_factory')->end()
24
            ->enumNode('translation_service')->values(array('google', 'foobar'))->defaultValue('google')->end()
25
            ->booleanNode('enabled')->defaultFalse()->end()
26
            ->scalarNode('default_locale')->defaultValue('en')->end()
27
            ->scalarNode('google_key')->defaultNull()->end()
28
        ->end();
29
30
        return $treeBuilder;
31
    }
32
}
33