Completed
Pull Request — master (#4433)
by Craig
10:17 queued 04:54
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 26

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 26
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 31
rs 9.504
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