Completed
Pull Request — master (#12)
by Alexey
08:20 queued 05:11
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 30
ccs 20
cts 28
cp 0.7143
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 24 1
1
<?php
2
/**
3
 * This file is part of the WoW-Apps/Symfony-Slack-Bot bundle for Symfony 3
4
 * https://github.com/wow-apps/symfony-slack-bot
5
 *
6
 * (c) 2016 WoW-Apps
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WowApps\SlackBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * @author Alexey Samara <[email protected]>
19
 * @package WowApps\SlackBundle
20
 */
21
class Configuration implements ConfigurationInterface
22
{
23
    /**
24
     * @inheritdoc
25
     */
26 1
    public function getConfigTreeBuilder()
27
    {
28 1
        $treeBuilder = new TreeBuilder();
29 1
        $rootNode = $treeBuilder->root('wow_apps_slack');
30
        $rootNode
31 1
            ->children()
32 1
                ->scalarNode('api_url')->defaultValue('')->end()
33 1
                ->scalarNode('default_icon')
34 1
                    ->defaultValue('http://cdn.wow-apps.pro/slackbot/slack-bot-icon-48.png')
35 1
                ->end()
36 1
                ->scalarNode('default_channel')->defaultValue('general')->end()
37 1
                    ->arrayNode('quote_color')
38 1
                    ->children()
39 1
                        ->scalarNode('default')->defaultValue('#607D8B')->end()
40 1
                        ->scalarNode('info')->defaultValue('#2196F3')->end()
41 1
                        ->scalarNode('warning')->defaultValue('#FF5722')->end()
42 1
                        ->scalarNode('success')->defaultValue('#8BC34A')->end()
43 1
                        ->scalarNode('danger')->defaultValue('#F44336')->end()
44 1
                    ->end()
45 1
                ->end()
46 1
            ->end();
47
48 1
        return $treeBuilder;
49
    }
50
}
51