Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 16
nc 1
nop 0
1
<?php
2
3
namespace UGA\Html2PDFBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * This is the class that validates and merges configuration from your app/config files.
10
 *
11
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function getConfigTreeBuilder()
19
    {
20
        $treeBuilder = new TreeBuilder();
21
        $rootNode = $treeBuilder->root('uga_html2_pdf');
22
23
                $rootNode
24
                ->children()
25
                ->scalarNode('html2_pdf_orientation')->defaultValue('P')->end()
26
                ->scalarNode('html2_pdf_format')->defaultValue('A4')->end()
27
                ->scalarNode('html2_pdf_lang')->defaultValue('en')->end()
28
                ->booleanNode('html2_pdf_unicode')->defaultTrue()->end()
29
                ->scalarNode('html2_pdf_encoding')->defaultValue('UTF-8')->end()
30
                ->arrayNode('html2_pdf_margin')
31
                    ->prototype('scalar')->end()
32
                    ->defaultValue(array(10, 15, 10, 15))
33
                ->end()
34
            ->end() ; 
35
36
        return $treeBuilder;
37
    }
38
}
39