Configuration::addBundlesSection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 1
1
<?php
2
3
namespace Khepin\YamlFixturesBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * This is the class that validates and merges configuration from your app/config files
10
 *
11
 * To learn more see
12
 * {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
13
 */
14
class Configuration implements ConfigurationInterface
15
{
16
    /**
17
     * {@inheritDoc}
18
     */
19
    public function getConfigTreeBuilder()
20
    {
21
        $treeBuilder = new TreeBuilder();
22
        $rootNode = $treeBuilder->root('khepin_yaml_fixtures');
23
        $rootNode
24
            ->children()
25
                ->scalarNode('directory')->defaultValue('DataFixtures')->end()
26
            ->end()
27
        ;
28
29
        $this->addBundlesSection($rootNode);
30
31
        return $treeBuilder;
32
    }
33
34
    public function addBundlesSection($rootNode)
35
    {
36
        $rootNode
37
            ->children()
38
                ->scalarNode('acl_manager')
39
                    ->treatNullLike('problematic.acl_manager')
40
                ->end()
41
                ->arrayNode('resources')->prototype('scalar')->end()->end()
42
            ->end()
43
        ;
44
    }
45
}
46