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

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 22 1
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