Completed
Push — master ( c7e9bf...6c9a09 )
by Théo
01:19
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 16
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 21
rs 9.3142
1
<?php
2
3
/*
4
 * This file is part of the PsyshBundle package.
5
 *
6
 * (c) Théo FIDRY <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Fidry\PsyshBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * @private
19
 */
20
final class Configuration implements ConfigurationInterface
21
{
22
    public function getConfigTreeBuilder()
23
    {
24
        $treeBuilder = new TreeBuilder();
25
        $rootNode = $treeBuilder->root('psysh');
26
27
        $rootNode
28
            ->children()
29
                ->arrayNode('variables')
30
                    ->info('Define additional variables to be exposed in Psysh')
31
                    ->useAttributeAsKey('variable_name')
32
                    ->example([
33
                        'debug' => '%kernel.debug%',
34
                        'my_service' => '@my.service',
35
                        'os' => ['linux', 'macos', 'losedows'],
36
                    ])
37
                    ->prototype('variable')->end()
38
                ->end()
39
            ->end();
40
41
        return $treeBuilder;
42
    }
43
}
44