Test Setup Failed
Push — master ( 2fd16d...50202e )
by Alexey
09:14
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
lcom 0
cbo 3
dl 0
loc 30
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 24 1
1
<?php
2
3
namespace Wowapps\SlackBundle\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('wowapps_slack');
22
        $rootNode
23
            ->children()
24
                ->scalarNode('api_url')->defaultValue('')->end()
25
                ->scalarNode('default_icon')
26
                    ->defaultValue('http://cdn.wow-apps.pro/slackbot/slack-bot-icon-48.png')
27
                ->end()
28
                ->scalarNode('default_channel')->defaultValue('general')->end()
29
                    ->arrayNode('quote_color')
30
                    ->children()
31
                        ->scalarNode('default')->defaultValue('#607D8B')->end()
32
                        ->scalarNode('info')->defaultValue('#2196F3')->end()
33
                        ->scalarNode('warning')->defaultValue('#FF5722')->end()
34
                        ->scalarNode('success')->defaultValue('#8BC34A')->end()
35
                        ->scalarNode('danger')->defaultValue('#F44336')->end()
36
                    ->end()
37
                ->end()
38
            ->end()
39
        ;
40
        return $treeBuilder;
41
    }
42
}
43