Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 22
rs 9.2
cc 1
eloc 19
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Knowledge Base package.
5
 *
6
 * Copyright (c) 2015 LIN3S <[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 LIN3S\KnowledgeBaseBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * Class Configuration.
19
 *
20
 * Defines the config tree editable from the config.yml file.
21
 *
22
 * @author Gorka Laucirica <[email protected]>
23
 */
24
class Configuration implements ConfigurationInterface
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function getConfigTreeBuilder()
30
    {
31
        $treeBuilder = new TreeBuilder();
32
        $treeBuilder->root('lin3_s_knowledge_base')
33
            ->children()
34
                ->scalarNode('docs_path')
35
                    ->defaultValue('%kernel.root_dir%/../docs/')
36
                ->end()
37
                ->scalarNode('build_path')
38
                    ->defaultValue('%kernel.cache_dir%/lin3s_knowledge_base/')
39
                ->end()
40
                ->scalarNode('template')
41
                    ->isRequired()
42
                ->end()
43
                ->scalarNode('assets_base_url')
44
                    ->defaultValue('/templates')
45
                ->end()
46
            ->end()
47
        ->end();
48
49
        return $treeBuilder;
50
    }
51
}
52