Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 22
rs 9.2
cc 1
eloc 16
nc 1
nop 0
1
<?php
2
3
namespace Chrl\AppBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * This is the class that validates and merges configuration from your app/config files
10
 */
11
class Configuration implements ConfigurationInterface
12
{
13
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function getConfigTreeBuilder()
18
    {
19
        $treeBuilder = new TreeBuilder();
20
        $rootNode = $treeBuilder->root('buktopuha');
21
22
23
        $rootNode
24
                ->children()
25
                    ->scalarNode("token")->isRequired()->end()
26
                    ->scalarNode("bot_name")->end()
27
                    ->arrayNode("webhook")
28
                    ->children()
29
                        ->scalarNode("domain")->end()
30
                        ->scalarNode("path_prefix")->end()
31
                        ->scalarNode("update_receiver")->defaultValue("app.update_receiver")->end()
32
                    ->end()
33
                    ->end()
34
                ->end();
35
36
37
        return $treeBuilder;
38
    }
39
}
40