Configuration::getConfigTreeBuilder()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 31
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 22
nc 1
nop 0
1
<?php
2
3
namespace Fenrizbes\TypographBundle\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
    public function getConfigTreeBuilder()
11
    {
12
        $treeBuilder = new TreeBuilder();
13
        $rootNode = $treeBuilder->root('fenrizbes_typograph');
14
15
        $rootNode
16
            ->children()
17
                ->arrayNode('configs')
18
                    ->useAttributeAsKey('name')
19
20
                    ->prototype('array')
21
                        ->useAttributeAsKey('name')
22
                        ->prototype('variable')->end()
23
                    ->end()
24
25
                    ->defaultValue(array(
26
                        'default' => array(
27
                            'Text.paragraphs'           => 'off',
28
                            'Text.breakline'            => 'off',
29
                            'Text.auto_links'           => 'off',
30
                            'Text.email'                => 'off',
31
                            'OptAlign.oa_oquote'        => 'off',
32
                            'OptAlign.oa_obracket_coma' => 'off'
33
                        )
34
                    ))
35
                ->end()
36
            ->end()
37
        ;
38
39
        return $treeBuilder;
40
    }
41
}
42