Completed
Push — master ( 80ba2b...8bd5d2 )
by Craig
14:31
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 27
c 1
b 0
f 0
dl 0
loc 33
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 31 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula - https://ziku.la/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Zikula\ThemeModule\DependencyInjection;
15
16
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
17
use Symfony\Component\Config\Definition\ConfigurationInterface;
18
19
class Configuration implements ConfigurationInterface
20
{
21
    public function getConfigTreeBuilder()
22
    {
23
        $treeBuilder = new TreeBuilder('zikula_theme');
24
25
        $treeBuilder->getRootNode()
26
            ->children()
27
                ->enumNode('script_position')
28
                    ->values(['head', 'foot'])
29
                    ->defaultValue('foot')
30
                ->end()
31
                ->arrayNode('bootstrap')
32
                    ->addDefaultsIfNotSet()
33
                    ->children()
34
                        ->scalarNode('css_path')->defaultValue('/bootstrap/css/bootstrap.min.css')->end()
35
                        ->scalarNode('js_path')->defaultValue('/bootstrap/js/bootstrap.bundle.min.js')->end()
36
                    ->end()
37
                ->end() // bootstrap
38
                ->scalarNode('font_awesome_path')->defaultValue('/font-awesome/css/all.min.css')->end()
39
                ->arrayNode('asset_manager')
40
                    ->addDefaultsIfNotSet()
41
                    ->children()
42
                        ->booleanNode('combine')->defaultFalse()->end()
43
                        ->scalarNode('lifetime')->defaultValue('1 day')->end()
44
                        ->booleanNode('compress')->defaultTrue()->end()
45
                        ->booleanNode('minify')->defaultTrue()->end()
46
                    ->end()
47
                ->end() // zikula_asset_manager
48
            ->end()
49
        ;
50
51
        return $treeBuilder;
52
    }
53
}
54