Passed
Push — master ( b4ffa5...5e9158 )
by Reyo
02:46
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 10
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 16
ccs 0
cts 13
cp 0
crap 2
rs 9.9332
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the uptime-robot bundle package.
7
 * (c) Connect Holland.
8
 */
9
10
namespace ConnectHolland\UptimeRobotBundle\DependencyInjection;
11
12
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
13
use Symfony\Component\Config\Definition\ConfigurationInterface;
14
15
final class Configuration implements ConfigurationInterface
16
{
17
    public const CONFIG_ROOT_KEY = 'connectholland_uptime_robot';
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function getConfigTreeBuilder()
23
    {
24
        $treeBuilder = new TreeBuilder(self::CONFIG_ROOT_KEY);
25
26
        $rootNode = $treeBuilder->getRootNode();
27
28
        $rootNode
29
            ->children()
30
                ->scalarNode('api_key')
31
                    ->isRequired()
32
                    ->cannotBeEmpty()
33
                ->end()
34
            ->end()
35
        ;
36
37
        return $treeBuilder;
38
    }
39
}
40