Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 13
Bugs 1 Features 7
Metric Value
wmc 1
c 13
b 1
f 7
lcom 0
cbo 3
dl 0
loc 45
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 39 1
1
<?php
2
3
namespace Hshn\AngularBundle\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
    /**
11
     * {@inheritDoc}
12
     */
13
    public function getConfigTreeBuilder()
14
    {
15
        $treeBuilder = new TreeBuilder();
16
17
        $rootNode = $treeBuilder->root('hshn_angular');
18
        $rootNode
19
            ->children()
20
                ->arrayNode('template_cache')
21
                    ->addDefaultsIfNotSet()
22
                    ->children()
23
                        ->scalarNode('dump_path')->defaultValue('%kernel.root_dir%/../web/js/hshn_angular_template_cache.js')->end()
24
                        ->arrayNode('modules')
25
                            ->useAttributeAsKey('key')
26
                            ->prototype('array')
27
                                ->children()
28
                                    ->booleanNode('create')->cannotBeEmpty()->defaultFalse()->info('Generate template caches into the new module. If not, generate into existed one.')->end()
29
                                    ->scalarNode('name')->defaultNull()->end()
30
                                    ->arrayNode('targets')
31
                                        ->beforeNormalization()
32
                                            ->ifString()
33
                                            ->then(function ($v) {
34
                                                return array($v);
35
                                            })
36
                                        ->end()
37
                                        ->isRequired()
38
                                        ->prototype('scalar')->end()
39
                                    ->end()
40
                                ->end()
41
                            ->end()
42
                        ->end()
43
                    ->end()
44
                ->end()
45
                ->arrayNode('assetic')
46
                ->end()
47
            ->end()
48
        ;
49
50
        return $treeBuilder;
51
    }
52
}
53