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

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 21 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\Bundle\CoreBundle\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 const DEFAULT_DATADIR = 'public/uploads';
22
23
    public function getConfigTreeBuilder()
24
    {
25
        $treeBuilder = new TreeBuilder('core');
26
27
        $treeBuilder->getRootNode()
28
            ->children()
29
                ->scalarNode('datadir')->defaultValue(self::DEFAULT_DATADIR)->end()
30
                ->scalarNode('maker_root_namespace')->defaultNull()->end()
31
                ->arrayNode('multisites')
32
                    ->addDefaultsIfNotSet()
33
                    ->children()
34
                        ->booleanNode('enabled')->defaultFalse()->end()
35
                        ->scalarNode('mainsiteurl')->defaultNull()->end()
36
                        ->scalarNode('based_on_domains')->defaultNull()->end()
37
                        ->arrayNode('protected_systemvars')->addDefaultsIfNotSet()->end()
38
                    ->end()
39
                ->end() // multisites
40
            ->end()
41
        ;
42
43
        return $treeBuilder;
44
    }
45
}
46