Completed
Pull Request — master (#18)
by Christophe
05:57 queued 01:08
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 29
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 31
ccs 29
cts 29
cp 1
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 28
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Incenteev\TranslationCheckerBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
class Configuration implements ConfigurationInterface
9
{
10 6
    public function getConfigTreeBuilder()
11
    {
12 6
        $treeBuilder = new TreeBuilder();
13 6
        $treeBuilder->root('incenteev_translation_checker')
14 6
            ->children()
15 6
                ->arrayNode('extraction')
16 6
                    ->addDefaultsIfNotSet()
17 6
                    ->fixXmlConfig('bundle')
18 6
                    ->children()
19 6
                        ->arrayNode('bundles')
20 6
                            ->prototype('scalar')->end()
21 6
                        ->end()
22 6
                        ->arrayNode('js')
23 6
                            ->addDefaultsIfNotSet()
24 6
                            ->fixXmlConfig('path')
25 6
                            ->children()
26 6
                                ->scalarNode('default_domain')
27 6
                                    ->info('The default domain used for JS translation (should match the JsTranslationBundle config)')
28 6
                                    ->defaultValue('messages')
29 6
                                ->end()
30 6
                                ->arrayNode('paths')
31 6
                                    ->prototype('scalar')->end()
32 6
                                ->end()
33 6
                            ->end()
34 6
                        ->end()
35 6
                    ->end()
36 6
                ->end()
37 6
            ->end();
38
39 6
        return $treeBuilder;
40 1
    }
41
}
42