Completed
Push — master ( 324ca9...bf4d68 )
by Sullivan
8s
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 23 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')->isRequired()->cannotBeEmpty()->end()
21
                ->scalarNode('channel')->defaultNull()->end()
22
                ->scalarNode('username')->defaultNull()->end()
23
                ->scalarNode('icon')->defaultNull()->end()
24
                ->booleanNode('link_names')->defaultFalse()->end()
25
                ->booleanNode('unfurl_links')->defaultFalse()->end()
26
                ->booleanNode('unfurl_media')->defaultTrue()->end()
27
                ->booleanNode('allow_markdown')->defaultTrue()->end()
28
                ->arrayNode('markdown_in_attachments')
29
                    ->prototype('scalar')->end()
30
                ->end()
31
            ->end()
32
        ;
33
34
        return $treeBuilder;
35
    }
36
}
37