Configuration::processConfiguration()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 41
Code Lines 39

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 41
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 39
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Ivory Lucene Search package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WellCommerce\Bundle\CoreBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
15
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
16
use Symfony\Component\Config\Definition\ConfigurationInterface;
17
18
/**
19
 * Class Configuration
20
 *
21
 * @author  Adam Piotrowski <[email protected]>
22
 */
23
class Configuration implements ConfigurationInterface
24
{
25
    public function getConfigTreeBuilder()
26
    {
27
        $treeBuilder = new TreeBuilder();
28
        $rootNode    = $treeBuilder->root('well_commerce_core');
29
        $this->processConfiguration($rootNode);
30
        
31
        return $treeBuilder;
32
    }
33
    
34
    //@formatter:off
35
    protected function processConfiguration(ArrayNodeDefinition $node)
36
    {
37
        $node
0 ignored issues
show
Bug introduced by
The method arrayNode() does not seem to exist on object<Symfony\Component...odeDefinitionInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38
            ->children()
39
                ->arrayNode('routers')
40
                    ->defaultValue(['router.default' => 100])
41
                    ->useAttributeAsKey('id')
42
                    ->prototype('scalar')->end()
43
                ->end()
44
                ->arrayNode('dynamic_routing')
45
                    ->useAttributeAsKey('name')
46
                    ->prototype('array')
47
                        ->children()
48
                            ->scalarNode('entity')->isRequired()->end()
49
                            ->arrayNode('defaults')
50
                                ->useAttributeAsKey('name')
51
                                ->prototype('scalar')->end()
52
                            ->end()
53
                            ->arrayNode('requirements')
54
                               ->useAttributeAsKey('name')
55
                                ->prototype('scalar')->end()
56
                            ->end()
57
                            ->arrayNode('options')
58
                                ->prototype('array')->end()
59
                                ->children()
60
                                    ->arrayNode('breadcrumb')
61
                                        ->children()
62
                                            ->scalarNode('label')->isRequired()->end()
63
                                            ->scalarNode('css_class')->defaultValue('')->end()
64
                                            ->scalarNode('route')->defaultValue('')->end()
65
                                            ->scalarNode('parent_route')->defaultValue('')->end()
66
                                        ->end()
67
                                    ->end()
68
                                ->end()
69
                            ->end()
70
                            ->scalarNode('pattern')->defaultValue('')->end()
71
                        ->end()
72
                    ->end()
73
                ->end()
74
            ->end();
75
    }
76
    //@formatter:on
77
}
78