Completed
Push — master ( 6b7dcc...b3fe52 )
by Alexey
11:45
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 8.9713
c 0
b 0
f 0
cc 1
eloc 21
nc 1
nop 0
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
 * Class Configuration
19
 * @author Alexey Samara <[email protected]>
20
 * @package WowApps\SlackBundle
21
 */
22
class Configuration implements ConfigurationInterface
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function getConfigTreeBuilder()
28
    {
29
        $treeBuilder = new TreeBuilder();
30
        $rootNode = $treeBuilder->root('wow_apps_slack');
31
        $rootNode
32
            ->children()
33
                ->scalarNode('api_url')->defaultValue('')->end()
34
                ->scalarNode('default_icon')
35
                    ->defaultValue('http://cdn.wow-apps.pro/slackbot/slack-bot-icon-48.png')
36
                ->end()
37
                ->scalarNode('default_channel')->defaultValue('general')->end()
38
                    ->arrayNode('quote_color')
39
                    ->children()
40
                        ->scalarNode('default')->defaultValue('#607D8B')->end()
41
                        ->scalarNode('info')->defaultValue('#2196F3')->end()
42
                        ->scalarNode('warning')->defaultValue('#FF5722')->end()
43
                        ->scalarNode('success')->defaultValue('#8BC34A')->end()
44
                        ->scalarNode('danger')->defaultValue('#F44336')->end()
45
                    ->end()
46
                ->end()
47
            ->end()
48
        ;
49
        return $treeBuilder;
50
    }
51
}
52