Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 18
rs 9.4286
cc 1
eloc 15
nc 1
nop 0
1
<?php
2
3
namespace Evheniy\TwitterBootstrapBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * Class Configuration
10
 * @package Evheniy\TwitterBootstrapBundle\DependencyInjection
11
 */
12
class Configuration implements ConfigurationInterface
13
{
14
    /**
15
     * @return TreeBuilder
16
     */
17
    public function getConfigTreeBuilder()
18
    {
19
        $treeBuilder = new TreeBuilder();
20
        $rootNode = $treeBuilder->root('twitter_bootstrap');
21
        $rootNode
22
            ->children()
23
                ->scalarNode('version')->defaultValue('3.3.4')->end()
24
                ->scalarNode('local_cdn')->defaultValue('')->end()
25
                ->scalarNode('local_js')->defaultValue('@TwitterBootstrapBundle/Resources/public/js/bootstrap.min.js')->end()
26
                ->scalarNode('local_fonts_dir')->defaultValue('@TwitterBootstrapBundle/Resources/public/fonts/')->end()
27
                ->scalarNode('local_css')->defaultValue('@TwitterBootstrapBundle/Resources/public/css/bootstrap.min.css')->end()
28
                ->scalarNode('local_theme')->defaultValue('@TwitterBootstrapBundle/Resources/public/css/bootstrap-theme.min.css')->end()
29
                ->booleanNode('html5')->defaultTrue()->end()
30
                ->booleanNode('async')->defaultFalse()->end()
31
            ->end();
32
33
        return $treeBuilder;
34
    }
35
}