Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 23 1
1
<?php
2
3
/**
4
 * This file is part of Bldr.io
5
 *
6
 * (c) Aaron Scherer <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE
10
 */
11
12
namespace Bldr\Block\Notify;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * @author Aaron Scherer <[email protected]>
19
 */
20
class Configuration implements ConfigurationInterface
21
{
22
    /**
23
     * {@inheritDoc}
24
     */
25
    public function getConfigTreeBuilder()
26
    {
27
        $treeBuilder = new TreeBuilder();
28
        $rootNode    = $treeBuilder->root('notify');
29
30
        $rootNode
31
            ->children()
32
                ->arrayNode('smtp')
33
                    ->children()
34
                        ->scalarNode('host')->isRequired()->end()
35
                        ->integerNode('port')->end()
36
                        ->enumNode('security')
37
                            ->values([null, 'ssl'])
38
                        ->end()
39
                        ->scalarNode('username')->isRequired()->end()
40
                        ->scalarNode('password')->isRequired()->end()
41
                    ->end()
42
                ->end()
43
            ->end()
44
        ;
45
46
        return $treeBuilder;
47
    }
48
}
49