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

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 30
ccs 18
cts 18
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 24 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