Completed
Push — master ( 360ac5...2ab452 )
by Alexey
07:01 queued 03:11
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
 * @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