Test Setup Failed
Push — master ( 66f5b7...72fefc )
by Alexey
11:50
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 25 1
1
<?php
2
3
namespace WowApps\SlackBotBundle\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/configuration.html}
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function getConfigTreeBuilder()
19
    {
20
        $treeBuilder = new TreeBuilder();
21
        $rootNode = $treeBuilder->root('wow_apps_slack_bot');
22
23
        $rootNode
24
            ->children()
25
                ->scalarNode('api_url')->defaultValue('')->end()
26
                ->scalarNode('default_icon')
27
                    ->defaultValue('http://cdn.wow-apps.pro/slackbot/slack-bot-icon-48.png')
28
                    ->end()
29
                ->scalarNode('default_channel')->defaultValue('general')->end()
30
                ->arrayNode('quote_color')
31
                    ->children()
32
                        ->scalarNode('default')->defaultValue('#607D8B')->end()
33
                        ->scalarNode('info')->defaultValue('#2196F3')->end()
34
                        ->scalarNode('warning')->defaultValue('#FF5722')->end()
35
                        ->scalarNode('success')->defaultValue('#8BC34A')->end()
36
                        ->scalarNode('danger')->defaultValue('#F44336')->end()
37
                    ->end()
38
                ->end()
39
            ->end();
40
41
        return $treeBuilder;
42
    }
43
}
44