Configuration::getConfigTreeBuilder()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 20
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 26
ccs 20
cts 20
cp 1
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 21
nc 1
nop 0
crap 1
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 4
    public function getConfigTreeBuilder()
17
    {
18 4
        $treeBuilder = new TreeBuilder();
19 4
        $rootNode = $treeBuilder->root('zenstruck_asset_manifest');
20
21
        $rootNode
22 4
            ->children()
23 4
                ->scalarNode('manifest_file')
24 4
                    ->defaultNull()
25 4
                ->end()
26 4
                ->arrayNode('prefix')
27 4
                    ->addDefaultsIfNotSet()
28 4
                    ->children()
29 4
                        ->scalarNode('source')
30 4
                            ->defaultNull()
31 4
                        ->end()
32 4
                        ->scalarNode('destination')
33 4
                            ->defaultNull()
34 4
                        ->end()
35 4
                    ->end()
36 4
                ->end()
37 4
            ->end()
38
        ;
39
40 4
        return $treeBuilder;
41
    }
42
}
43