Completed
Pull Request — master (#29)
by Yann
01:35
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 14
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 14
cts 14
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 15
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Yokai\Enum\Bridge\Symfony\Bundle\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 5
    public function getConfigTreeBuilder()
17
    {
18 5
        $treeBuilder = new TreeBuilder();
19 5
        $rootNode = $treeBuilder->root('yokai_enum');
20
21
        $rootNode
22 5
            ->children()
23 5
                ->booleanNode('enum_autoconfiguration')
24 5
                    ->info('If set to true, all services that implements EnumInterface, will obtain the "enum" tag automatically.')
25 5
                    ->defaultTrue()
26 5
                ->end()
27 5
                ->booleanNode('enum_registry_autoconfigurable')
28 5
                    ->info('If set to true, add an alias for the enum registry so your service can ask for it via autoconfiguration.')
29 5
                    ->defaultTrue()
30 5
                ->end()
31 5
            ->end()
32
        ;
33
34 5
        return $treeBuilder;
35
    }
36
}
37