Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 45 1
1
<?php
2
3
namespace Decline\TransformatBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * This is the class that validates and merges configuration from your app/config files.
10
 *
11
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function getConfigTreeBuilder()
19
    {
20
        $treeBuilder = new TreeBuilder();
21
        $rootNode = $treeBuilder->root('decline_transformat');
22
23
        $rootNode
24
            ->children()
25
                ->scalarNode('directory')
26
                    ->info('The directory where the translation files are located.')
27
                    ->isRequired()
28
                ->end()
29
                ->arrayNode('xliff')
30
                    ->addDefaultsIfNotSet()
31
                    ->children()
32
                        ->enumNode('extension')
33
                            ->info('The extension of the translation files which should be formatted.')
34
                            ->defaultValue('xlf')
35
                            ->values(['xlf', 'xliff'])
36
                        ->end()
37
                    ->end()
38
                    ->children()
39
                        ->scalarNode('sourceLanguage')
40
                            ->info('The source language of the translation files.')
41
                            ->defaultValue('en')
42
                        ->end()
43
                    ->end()
44
                    ->children()
45
                        ->scalarNode('namespace')
46
                            ->info('The xml namespace translation files.')
47
                            ->defaultValue('urn:oasis:names:tc:xliff:document:1.2')
48
                        ->end()
49
                    ->end()
50
                    ->children()
51
                        ->enumNode('validation')
52
                            ->info('The type of validation that should be applied to the xliff files.')
53
                            ->defaultValue(false)
54
                            ->values([false, 'transitional', 'strict'])
55
                        ->end()
56
                    ->end()
57
                ->end()
58
            ->end()
59
        ;
60
61
        return $treeBuilder;
62
    }
63
}
64