Passed
Push — master ( c2b2ef...c33329 )
by DELEVOYE
02:48
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 0
cts 22
cp 0
rs 9.0856
c 0
b 0
f 0
cc 1
eloc 20
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of the MindbazBundle package.
5
 *
6
 * (c) David DELEVOYE <[email protected]>
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 Kozikaza\MindbazBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * This is the class that validates and merges configuration from your app/config files
19
 *
20
 * To learn more see {@link
21
 * http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
22
 *
23
 * @author Vincent Chalamon <[email protected]>
24
 */
25
class Configuration implements ConfigurationInterface
26
{
27
    /**
28
     * {@inheritDoc}
29
     */
30
    public function getConfigTreeBuilder()
31
    {
32
        $treeBuilder = new TreeBuilder();
33
        $rootNode = $treeBuilder->root('mindbaz');
34
        $rootNode
35
            ->children()
36
                ->arrayNode('credentials')
37
                    ->children()
38
                        ->integerNode('idSite')->treatNullLike(0)->end()
39
                        ->scalarNode('login')->end()
40
                        ->scalarNode('password')->end()
41
                    ->end()
42
                ->end()
43
                ->arrayNode('campaigns')
44
                    ->useAttributeAsKey('name')
45
                    ->normalizeKeys(false)
46
                    ->prototype('scalar')->end()
47
                ->end()
48
                ->booleanNode('insertMissingSubscribers')->defaultFalse()->end()
49
            ->end();
50
51
        return $treeBuilder;
52
    }
53
}
54