Completed
Pull Request — master (#5)
by Kevin
04:25
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 26
ccs 0
cts 24
cp 0
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 21
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Zenstruck\AssetManifestBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * @author Kevin Bond <[email protected]>
10
 */
11
final class Configuration implements ConfigurationInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function getConfigTreeBuilder()
17
    {
18
        $treeBuilder = new TreeBuilder();
19
        $rootNode = $treeBuilder->root('zenstruck_asset_manifest');
20
21
        $rootNode
22
            ->children()
23
                ->scalarNode('manifest_file')
24
                    ->defaultNull()
25
                ->end()
26
                ->arrayNode('prefix')
27
                    ->addDefaultsIfNotSet()
28
                    ->children()
29
                        ->scalarNode('source')
30
                            ->defaultNull()
31
                        ->end()
32
                        ->scalarNode('destination')
33
                            ->defaultNull()
34
                        ->end()
35
                    ->end()
36
                ->end()
37
            ->end()
38
        ;
39
40
        return $treeBuilder;
41
    }
42
}
43