Completed
Push — master ( c8164f...4b13e9 )
by Nikola
10:41 queued 08:42
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 12
cts 12
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 13
nc 1
nop 0
crap 1
1
<?php
2
/*
3
 * This file is part of the QueryResourcesLoaderBundle, an RunOpenCode project.
4
 *
5
 * (c) 2017 RunOpenCode.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace RunOpenCode\Bundle\QueryResourcesLoader\DependencyInjection\Configuration;
11
12
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
13
use Symfony\Component\Config\Definition\ConfigurationInterface;
14
15
/**
16
 * Class Configuration
17
 *
18
 * Bundle configuration tree.
19
 *
20
 * @package RunOpenCode\Bundle\QueryResourcesLoader\DependencyInjection
21
 */
22
class Configuration implements ConfigurationInterface
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27 2
    public function getConfigTreeBuilder()
28
    {
29 2
        $treeBuilder = new TreeBuilder();
30
31 2
        $rootNode = $treeBuilder->root('run_open_code_query_resources_loader');
32
33
        $rootNode
34 2
            ->addDefaultsIfNotSet()
35 2
            ->children()
36 2
                ->scalarNode('default_executor')
37 2
                    ->defaultValue(null)
38 2
                    ->info('Default executor that will be used in "execute" calls. If not stated, first registered executor will be default one.')
39 2
                ->end()
40 2
                ->append(new TwigNodeDefinition())
41 2
            ->end()
42
            ;
43
44 2
        return $treeBuilder;
45
    }
46
}
47