Completed
Pull Request — master (#4)
by Laurens
05:13
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 27 1
1
<?php
2
namespace Werkspot\BingAdsApiBundle\DependencyInjection;
3
4
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
5
use Symfony\Component\Config\Definition\ConfigurationInterface;
6
7
/**
8
 * This is the class that validates and merges configuration from your app/config files
9
 *
10
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
11
 */
12
class Configuration implements ConfigurationInterface
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function getConfigTreeBuilder()
18
    {
19
        $treeBuilder = new TreeBuilder();
20
        $rootNode = $treeBuilder->root('werkspot_bing_ads_api');
21
22
        $rootNode
23
            ->children()
24
                ->scalarNode('cache_dir')
25
                    ->defaultValue('%kernel.cache_dir%')
26
                    ->cannotBeEmpty()
27
                ->end()
28
                ->arrayNode('csv')
29
                    ->children()
30
                        ->arrayNode('fixHeader')
31
                            ->children()
32
                                ->booleanNode('removeColumnHeader')
33
                                    ->defaultFalse()
34
                                ->end()
35
                            ->end()
36
                        ->end()
37
                    ->end()
38
                ->end()
39
40
            ->end();
41
42
        return $treeBuilder;
43
    }
44
}
45