Completed
Push — master ( 9d31f0...bba394 )
by Alexey
02:33
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 24

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 20
CRAP Score 1.0007

Importance

Changes 0
Metric Value
dl 0
loc 24
ccs 20
cts 22
cp 0.9091
rs 9.536
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1.0007
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 1
    public function getConfigTreeBuilder()
28
    {
29 1
        $treeBuilder = new TreeBuilder();
30 1
        $rootNode = $treeBuilder->root('wow_apps_slack');
31
        $rootNode
32 1
            ->children()
33 1
                ->scalarNode('api_url')->defaultValue('')->end()
34 1
                ->scalarNode('default_icon')
35 1
                    ->defaultValue('http://cdn.wow-apps.pro/slackbot/slack-bot-icon-48.png')
36 1
                ->end()
37 1
                ->scalarNode('default_channel')->defaultValue('general')->end()
38 1
                    ->arrayNode('quote_color')
39 1
                    ->children()
40 1
                        ->scalarNode('default')->defaultValue('#607D8B')->end()
41 1
                        ->scalarNode('info')->defaultValue('#2196F3')->end()
42 1
                        ->scalarNode('warning')->defaultValue('#FF5722')->end()
43 1
                        ->scalarNode('success')->defaultValue('#8BC34A')->end()
44 1
                        ->scalarNode('danger')->defaultValue('#F44336')->end()
45 1
                    ->end()
46 1
                ->end()
47 1
            ->end()
48
        ;
49 1
        return $treeBuilder;
50
    }
51
}
52