Configuration::getConfigTreeBuilder()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 29
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 24
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the dotfiles project.
7
 *
8
 *     (c) Anthonius Munthi <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Dotfiles\Plugins\PHPBrew;
15
16
use Dotfiles\Core\Config\DefinitionInterface;
17
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
18
19
class Configuration implements DefinitionInterface
20
{
21
    public function getConfigTreeBuilder()
22
    {
23
        $treeBuilder = new TreeBuilder();
24
25
        $rootNode = $treeBuilder->root('phpbrew');
26
        $rootNode
27
            ->children()
28
                ->booleanNode('set_prompt')
29
                    ->defaultTrue()
30
                ->end()
31
                ->booleanNode('rc_enable')
32
                    ->defaultTrue()
33
                ->end()
34
                ->arrayNode('machines')
35
                    ->prototype('array')
36
                    ->children()
37
                            ->booleanNode('set_prompt')
38
                                ->defaultTrue()
39
                            ->end()
40
                            ->booleanNode('rc_enable')
41
                                ->defaultTrue()
42
                            ->end()
43
                        ->end()
44
                    ->end()
45
                ->end()
46
            ->end()
47
        ;
48
49
        return $treeBuilder;
50
    }
51
}
52