Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 3
dl 0
loc 29
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 26 1
1
<?php
2
3
namespace Nexy\SlackBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * @author Sullivan Senechal <[email protected]>
10
 */
11
class Configuration implements ConfigurationInterface
12
{
13
    public function getConfigTreeBuilder()
14
    {
15
        $treeBuilder = new TreeBuilder();
16
        $rootNode = $treeBuilder->root('nexy_slack');
17
18
        $rootNode
19
            ->children()
20
                ->scalarNode('endpoint')
21
                    ->isRequired()->cannotBeEmpty()
22
                    ->info('The Slack API Incoming WebHooks URL.')
23
                ->end()
24
                ->scalarNode('channel')->defaultNull()->end()
25
                ->scalarNode('username')->defaultNull()->end()
26
                ->scalarNode('icon')->defaultNull()->end()
27
                ->booleanNode('link_names')->defaultFalse()->end()
28
                ->booleanNode('unfurl_links')->defaultFalse()->end()
29
                ->booleanNode('unfurl_media')->defaultTrue()->end()
30
                ->booleanNode('allow_markdown')->defaultTrue()->end()
31
                ->arrayNode('markdown_in_attachments')
32
                    ->prototype('scalar')->end()
33
                ->end()
34
            ->end()
35
        ;
36
37
        return $treeBuilder;
38
    }
39
}
40