Completed
Pull Request — master (#4433)
by Craig
12:07 queued 01:43
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 23
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 28
rs 9.552
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
                ->scalarNode('script_position')->defaultValue('foot')->end()
28
                ->arrayNode('bootstrap')
29
                    ->addDefaultsIfNotSet()
30
                    ->children()
31
                        ->scalarNode('css_path')->defaultValue('/bootstrap/css/bootstrap.min.css')->end()
32
                        ->scalarNode('js_path')->defaultValue('/bootstrap/js/bootstrap.bundle.min.js')->end()
33
                    ->end()
34
                ->end() // bootstrap
35
                ->scalarNode('font_awesome_path')->defaultValue('/font-awesome/css/all.min.css')->end()
36
                ->arrayNode('asset_manager')
37
                    ->addDefaultsIfNotSet()
38
                    ->children()
39
                        ->booleanNode('combine')->defaultValue(false)->end()
40
                        ->scalarNode('lifetime')->defaultValue('1 day')->end()
41
                        ->booleanNode('compress')->defaultValue(true)->end()
42
                        ->booleanNode('minify')->defaultValue(true)->end()
43
                    ->end()
44
                ->end() // zikula_asset_manager
45
            ->end()
46
        ;
47
48
        return $treeBuilder;
49
    }
50
}
51