Completed
Push — master ( 22edb8...c8c69d )
by Kévin
28:31 queued 28:31
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 22
rs 9.2
cc 1
eloc 19
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
15
/**
16
 * {@inheritdoc}
17
 *
18
 * @author Kévin Dunglas <[email protected]>
19
 */
20
class Configuration implements ConfigurationInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function getConfigTreeBuilder()
26
    {
27
        $treeBuilder = new TreeBuilder();
28
        $treeBuilder->root('dunglas_action')
29
            ->children()
30
                ->arrayNode('autodiscover')
31
                    ->info('Autodiscover action classes stored in the configured directory of bundles and register them as service.')
32
                    ->canBeDisabled()
33
                    ->children()
34
                        ->scalarNode('directory')->defaultValue('Action')->info('The directory name to autodiscover in bundles.')->end()
35
                    ->end()
36
                ->end()
37
                ->arrayNode('directories')
38
                    ->info('List of directories relative to the kernel root directory containing action classes.')
39
                    ->prototype('scalar')->end()
40
                    ->defaultValue([])
41
                ->end()
42
            ->end()
43
        ->end();
44
45
        return $treeBuilder;
46
    }
47
}
48