Completed
Push — master ( b9975d...05326a )
by Florent
06:18 queued 51s
created

SourceConfiguration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 17
rs 9.4285
cc 1
eloc 13
nc 1
nop 0
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2016 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace SpomkyLabs\JoseBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * Factory configuration for the Gaufrette DIC extension.
19
 *
20
 * @author Antoine Hérault <[email protected]>
21
 */
22
class SourceConfiguration implements ConfigurationInterface
23
{
24
    /**
25
     * Generates the configuration tree builder.
26
     *
27
     * @return TreeBuilder
28
     */
29
    public function getConfigTreeBuilder()
30
    {
31
        $treeBuilder = new TreeBuilder();
32
33
        $treeBuilder
34
            ->root('jose')
35
                ->ignoreExtraKeys()
36
                ->fixXmlConfig('key', 'keys')
37
                    ->children()
38
                        ->arrayNode('keys')
39
                        ->prototype('variable')->end()
40
                    ->end()
41
                ->end()
42
            ->end();
43
44
        return $treeBuilder;
45
    }
46
}
47