Completed
Pull Request — master (#28)
by Jérôme
09:50
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 16
nc 1
nop 0
dl 0
loc 21
rs 9.3142
c 0
b 0
f 0
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
class Configuration implements ConfigurationInterface
18
{
19
    public function getConfigTreeBuilder()
20
    {
21
        $treeBuilder = new TreeBuilder();
22
        $rootNode = $treeBuilder->root('psysh');
23
24
        $rootNode
25
            ->children()
26
                ->arrayNode('variables')
27
                    ->info('Define additional variables to be exposed in Psysh')
28
                    ->useAttributeAsKey('variable_name')
29
                    ->example([
30
                        'debug' => '%kernel.debug%',
31
                        'my_service' => '@my.service',
32
                        'os' => ['linux', 'macos', 'losedows'],
33
                    ])
34
                    ->prototype('variable')->end()
35
                ->end()
36
            ->end();
37
38
        return $treeBuilder;
39
    }
40
}
41