Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 14
nc 1
nop 0
dl 0
loc 18
rs 9.7998
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the smsmode-bundle package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\SmsModeBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
use WBW\Bundle\CoreBundle\Config\ConfigurationHelper;
17
18
/**
19
 * Configuration
20
 *
21
 * @author webeweb <https://github.com/webeweb>
22
 * @package WBW\Bundle\SmsModeBundle\DependencyInjection
23
 */
24
class Configuration implements ConfigurationInterface {
25
26
    /**
27
     * {@inheritDoc}
28
     */
29
    public function getConfigTreeBuilder(): TreeBuilder {
30
31
        $treeBuilder = new TreeBuilder(WBWSmsModeExtension::EXTENSION_ALIAS);
32
33
        $rootNode = ConfigurationHelper::getRootNode($treeBuilder, WBWSmsModeExtension::EXTENSION_ALIAS);
34
        $rootNode
35
            ->children()
36
                ->arrayNode("authentication")->addDefaultsIfNotSet()
37
                    ->children()
38
                        ->scalarNode("access_token")->defaultNull()->end()
39
                        ->scalarNode("pseudo")->defaultNull()->end()
40
                        ->scalarNode("pass")->defaultNull()->end()
41
                    ->end()
42
                ->end()
43
                ->booleanNode("event_listeners")->defaultTrue()->info("Load event listeners")->end()
44
            ->end();
45
46
        return $treeBuilder;
47
    }
48
}
49