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

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 23
ccs 0
cts 13
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 16 1
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