Configuration::getConfigTreeBuilder()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 8.9713
c 0
b 0
f 0
cc 1
eloc 19
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the ReportBundle package
5
 * 
6
 * (c) symball <http://simonball.me>
7
 * 
8
 * For the full copyright and license information, please view the LICENSE file 
9
 * that was distributed with this source code.
10
 */
11
12
namespace Symball\ReportBundle\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
 */
21
class Configuration implements ConfigurationInterface
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function getConfigTreeBuilder()
27
    {
28
        $treeBuilder = new TreeBuilder();
29
        $rootNode = $treeBuilder->root('symball_report');
30
31
        $rootNode
32
            ->children()
33
              ->scalarNode('excel_factory_namespace')
34
                ->defaultValue('\PHPExcel_IOFactory')
35
              ->end()
36
              ->scalarNode('layout_style')
37
                ->defaultValue('horizontal')
38
              ->end()
39
              ->scalarNode('output_format')
40
                ->defaultValue('Excel2007')
41
              ->end()
42
              ->scalarNode('default_report_path')
43
                ->isRequired()
44
              ->end()
45
            ->end()
46
        ;
47
48
        return $treeBuilder;
49
    }
50
}
51