Completed
Push — master ( cd21c6...a50cd0 )
by Craig
04:57
created

Configuration::addTranslatorSection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 18
nc 1
nop 1
dl 0
loc 20
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula Foundation - 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\ArrayNodeDefinition;
17
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
18
use Symfony\Component\Config\Definition\ConfigurationInterface;
19
20
/**
21
 * CoreExtension configuration structure.
22
 */
23
class Configuration implements ConfigurationInterface
24
{
25
    /**
26
     * @var bool
27
     */
28
    private $debug;
29
30
    public function __construct(bool $debug)
31
    {
32
        $this->debug = $debug;
33
    }
34
35
    public function getConfigTreeBuilder(): TreeBuilder
36
    {
37
        $treeBuilder = new TreeBuilder('framework');
38
//        $rootNode = $treeBuilder->getRootNode();
39
//        $this->addTranslatorSection($rootNode);
40
41
        return $treeBuilder;
42
    }
43
44
//    protected function addTranslatorSection(ArrayNodeDefinition $rootNode): void
45
//    {
46
//        $rootNode
47
//            ->children()
48
//            ->arrayNode('translator')
49
//            ->info('translator configuration')
50
//            ->canBeEnabled()
51
//            ->fixXmlConfig('fallback')
52
//            ->children()
53
//            ->arrayNode('fallbacks')
54
//            ->beforeNormalization()->ifString()->then(static function($v) {
55
//                return [$v];
56
//            })->end()
57
//            ->prototype('scalar')->end()
58
//            ->defaultValue(['en'])
59
//            ->end()
60
//            ->booleanNode('logging')->defaultValue($this->debug)->end()
61
//            ->end()
62
//            ->end()
63
//            ->end()
64
//        ;
65
//    }
66
}
67