Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 10
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the haveibeenpwned-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\HaveIBeenPwnedBundle\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\HaveIBeenPwnedBundle\DependencyInjection
23
 */
24
class Configuration implements ConfigurationInterface {
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function getConfigTreeBuilder(): TreeBuilder {
30
31
        $treeBuilder = new TreeBuilder(WBWHaveIBeenPwnedExtension::EXTENSION_ALIAS);
32
33
        $rootNode = ConfigurationHelper::getRootNode($treeBuilder, WBWHaveIBeenPwnedExtension::EXTENSION_ALIAS);
34
        $rootNode->children()
35
            ->booleanNode("event_listeners")->defaultTrue()->info("Load event listeners")->end()
36
            ->end();
37
38
        return $treeBuilder;
39
    }
40
}
41