Completed
Push — 2.x-dev-kit ( 971030 )
by
unknown
07:52
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 45 1
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\SeoBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * This is the class that validates and merges configuration from your app/config files.
19
 */
20
class Configuration implements ConfigurationInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function getConfigTreeBuilder()
26
    {
27
        $treeBuilder = new TreeBuilder();
28
29
        $treeBuilder->root('sonata_seo')
30
            ->children()
31
                ->scalarNode('encoding')->defaultValue('UTF-8')->end()
32
                ->arrayNode('page')
33
                    ->addDefaultsIfNotSet()
34
                    ->children()
35
                        ->scalarNode('default')->defaultValue('sonata.seo.page.default')->end()
36
                        ->arrayNode('head')
37
                            ->normalizeKeys(false)
38
                            ->useAttributeAsKey('attribute')
39
                            ->prototype('scalar')->end()
40
                        ->end()
41
                        ->arrayNode('metas')
42
                            ->normalizeKeys(false)
43
                            ->useAttributeAsKey('element')
44
                            ->prototype('array')
45
                                ->normalizeKeys(false)
46
                                ->useAttributeAsKey('name')
47
                                ->prototype('scalar')->end()
48
                            ->end()
49
                        ->end()
50
                        ->scalarNode('separator')->defaultValue(' - ')->end()
51
                        ->scalarNode('title')->defaultValue('Sonata Project')->end()
52
                    ->end()
53
                ->end()
54
                ->arrayNode('sitemap')
55
                    ->addDefaultsIfNotSet()
56
                    ->children()
57
                        ->arrayNode('doctrine_orm')
58
                            ->prototype('variable')->end()
59
                        ->end()
60
                        ->arrayNode('services')
61
                            ->prototype('variable')->end()
62
                        ->end()
63
                    ->end()
64
                ->end()
65
            ->end()
66
        ;
67
68
        return $treeBuilder;
69
    }
70
}
71