Completed
Push — master ( a8cc6f...2b0bc5 )
by Kévin
6s
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 8
Bugs 2 Features 1
Metric Value
c 8
b 2
f 1
dl 0
loc 22
rs 9.2
cc 1
eloc 18
nc 1
nop 0
1
<?php
2
3
/*
4
 * (c) Kévin Dunglas <[email protected]>
5
 *
6
 * This source file is subject to the MIT license that is bundled
7
 * with this source code in the file LICENSE.
8
 */
9
10
namespace Dunglas\ActionBundle\DependencyInjection;
11
12
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
13
use Symfony\Component\Config\Definition\ConfigurationInterface;
14
use Symfony\Component\Console\Command\Command;
15
16
/**
17
 * {@inheritdoc}
18
 *
19
 * @author Kévin Dunglas <[email protected]>
20
 */
21
class Configuration implements ConfigurationInterface
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function getConfigTreeBuilder()
27
    {
28
        $treeBuilder = new TreeBuilder();
29
        $treeBuilder->root('dunglas_action')
30
            ->fixXmlConfig('directory', 'directories')
31
            ->children()
32
                ->arrayNode('directories')
33
                    ->info('List of directories relative to the kernel root directory containing classes.')
34
                    ->useAttributeAsKey('prefix')
35
                    ->prototype('array')
36
                        ->prototype('scalar')->end()
37
                    ->end()
38
                    ->defaultValue([
39
                        'controller' => ['../src/*Bundle/Controller', '../src/*Bundle/Action'],
40
                        'command' => ['../src/*Bundle/Command'],
41
                    ])
42
                ->end()
43
            ->end()
44
        ->end();
45
46
        return $treeBuilder;
47
    }
48
}
49