Configuration::getConfigTreeBuilder()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 36
Code Lines 32

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 36
c 0
b 0
f 0
rs 8.8571
cc 1
eloc 32
nc 1
nop 0
1
<?php
2
3
namespace BreadcrumbsBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * Class Configuration
10
 * @package BreadcrumbsBundle\DependencyInjection
11
 */
12
class Configuration implements ConfigurationInterface
13
{
14
    /**
15
     * @return TreeBuilder
16
     */
17
    public function getConfigTreeBuilder(): TreeBuilder
18
    {
19
        $treeBuilder = new TreeBuilder();
20
        $rootNode = $treeBuilder->root('breadcrumbs');
21
22
        $rootNode
23
            ->children()
24
                ->arrayNode('separator')
25
                    ->addDefaultsIfNotSet()
26
                    ->children()
27
                        ->scalarNode('value')
28
                            ->defaultValue('/')
29
                        ->end()
30
                        ->scalarNode('class')
31
                            ->defaultValue('separator')
32
                        ->end()
33
                    ->end()
34
                ->end()
35
                ->arrayNode('list')
36
                    ->addDefaultsIfNotSet()
37
                    ->children()
38
                        ->scalarNode('type')
39
                            ->defaultValue('ul')
40
                        ->end()
41
                        ->scalarNode('class')
42
                            ->defaultValue('separator')
43
                        ->end()
44
                    ->end()
45
                ->end()
46
                ->scalarNode('template')
47
                    ->defaultValue('BreadcrumbsBundle::template.html.twig')
48
                ->end()
49
            ->end();
50
51
        return $treeBuilder;
52
    }
53
}