Completed
Push — master ( 209945...41a4bc )
by Matthew
07:41 queued 03:34
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 72
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 65 1
1
<?php
2
3
namespace Dtc\GridBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
class Configuration implements ConfigurationInterface
9
{
10
    /**
11
     * Generates the configuration tree.
12
     *
13
     * @return TreeBuilder
14
     */
15
    public function getConfigTreeBuilder()
16
    {
17
        $treeBuilder = new TreeBuilder();
18
        $rootNode = $treeBuilder->root('dtc_grid');
19
20
        $rootNode
21
            ->children()
22
                ->arrayNode('jq_grid')
23
                    ->children()
24
                        ->arrayNode('css')
25
                            ->prototype('scalar')->end()
26
                        ->end()
27
                        ->arrayNode('js')
28
                            ->prototype('scalar')->end()
29
                        ->end()
30
                    ->end()
31
                ->end()
32
                ->scalarNode('purl')
33
                    ->defaultValue('https://cdnjs.cloudflare.com/ajax/libs/purl/2.3.1/purl.min.js')
34
                ->end()
35
                ->arrayNode('jquery')
36
                    ->addDefaultsIfNotSet()
37
                    ->children()
38
                        ->scalarNode('url')
39
                            ->defaultValue('https://code.jquery.com/jquery-3.2.1.min.js')
40
                        ->end()
41
                        ->scalarNode('integrity')
42
                            ->defaultValue('sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=')
43
                        ->end()
44
                        ->scalarNode('crossorigin')
45
                            ->defaultValue('anonymous')
46
                        ->end()
47
                    ->end()
48
                ->end()
49
                ->arrayNode('datatables')
50
                    ->addDefaultsIfNotSet()
51
                    ->children()
52
                        ->arrayNode('css')
53
                            ->prototype('scalar')->end()
54
                            ->defaultValue(['https://cdn.datatables.net/1.10.16/css/dataTables.bootstrap.min.css'])
55
                        ->end()
56
                        ->arrayNode('js')
57
                            ->prototype('scalar')->end()
58
                            ->defaultValue(['https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js',
59
                                            'https://cdn.datatables.net/1.10.16/js/dataTables.bootstrap.min.js', ])
60
                        ->end()
61
                    ->end()
62
                ->end()
63
                ->arrayNode('theme')
64
                    ->addDefaultsIfNotSet()
65
                    ->children()
66
                        ->arrayNode('css')
67
                            ->prototype('scalar')->end()
68
                            ->defaultValue(['https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'])
69
                        ->end()
70
                        ->arrayNode('js')
71
                            ->prototype('scalar')->end()
72
                            ->defaultValue(['https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'])
73
                        ->end()
74
                    ->end()
75
                ->end()
76
                ->scalarNode('page_div_style')->defaultValue('margin: 10px')->end()
77
            ->end();
78
79
        return $treeBuilder;
80
    }
81
}
82