Completed
Push — master ( fe0508...11cb26 )
by Kirill
02:20
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 30
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 22 1
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
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function getConfigTreeBuilder()
20
    {
21
        $treeBuilder = new TreeBuilder();
22
        $rootNode = $treeBuilder->root('buktopuha');
23
24
25
        $rootNode
26
                ->children()
27
                    ->scalarNode("token")->isRequired()->end()
28
                    ->scalarNode("bot_name")->end()
29
                    ->arrayNode("webhook")
30
                    ->children()
31
                        ->scalarNode("domain")->end()
32
                        ->scalarNode("path_prefix")->end()
33
                        ->scalarNode("update_receiver")->defaultValue("app.update_receiver")->end()
34
                    ->end()
35
                    ->end()
36
                ->end();
37
38
39
        return $treeBuilder;
40
    }
41
42
}
43