Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 10
c 2
b 0
f 0
dl 0
loc 18
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 13 1
1
<?php
2
/*
3
 * This file is part of the CwdPowerDNS Client
4
 *
5
 * (c) 2018 cwd.at GmbH <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Cwd\PowerDNSClient\DependencyInjection;
14
15
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
16
use Symfony\Component\Config\Definition\ConfigurationInterface;
17
18
/**
19
 * This is the class that validates and merges configuration from your app/config files.
20
 *
21
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
22
 */
23
class Configuration implements ConfigurationInterface
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function getConfigTreeBuilder()
29
    {
30
        $treeBuilder = new TreeBuilder('cwd_power_dns_client');
31
        $rootNode = $treeBuilder->getRootNode();
32
        $rootNode->children()
33
            ->variableNode('hosts')->defaultValue([])->end()
34
35
            ->variableNode('uri')->defaultValue('http://localhost')->end()
36
            ->variableNode('api_key')->defaultValue(null)->end()
37
            ->variableNode('default_server')->defaultValue('localhost')->end()
38
        ->end();
39
40
        return $treeBuilder;
41
    }
42
}