Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 15
rs 9.4285
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
namespace Evheniy\JqueryBundle\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\JqueryBundle\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('jquery');
21
        $rootNode
22
            ->children()
23
                ->scalarNode('version')->defaultValue('1.11.3')->end()
24
                ->scalarNode('local')->defaultValue('@JqueryBundle/Resources/public/js/jquery-1.11.3.min.js')->end()
25
                ->booleanNode('html5')->defaultTrue()->end()
26
                ->booleanNode('async')->defaultFalse()->end()
27
                ->scalarNode('cdn')->defaultValue('')->end()
28
            ->end();
29
30
        return $treeBuilder;
31
    }
32
}