Completed
Pull Request — master (#28)
by Yann
02:07
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 18
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 24
ccs 18
cts 18
cp 1
rs 8.9713
c 1
b 0
f 0
cc 1
eloc 19
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Yokai\EnumBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * @author Yann Eugoné <[email protected]>
10
 */
11
class Configuration implements ConfigurationInterface
12
{
13
    /**
14
     * @inheritdoc
15
     */
16 4
    public function getConfigTreeBuilder()
17
    {
18 4
        $treeBuilder = new TreeBuilder();
19 4
        $rootNode = $treeBuilder->root('yokai_enum');
20
21
        $rootNode
22 4
            ->children()
23 4
                ->variableNode('register_bundles')
24 4
                    ->info('[DEPRECATED] bundles for which to auto-register enums.')
25 4
                    ->defaultFalse()
26 4
                ->end()
27 4
                ->booleanNode('enum_autoconfiguration')
28 4
                    ->info('If set to true, all services that implements EnumInterface, will obtain the "enum" tag automatically.')
29 4
                    ->defaultTrue()
30 4
                ->end()
31 4
                ->booleanNode('enum_registry_autoconfigurable')
32 4
                    ->info('If set to true, add an alias for the enum registry so your service can ask for it via autoconfiguration.')
33 4
                    ->defaultTrue()
34 4
                ->end()
35 4
            ->end()
36
        ;
37
38 4
        return $treeBuilder;
39
    }
40
}
41