Completed
Push — master ( 124fed...6caa0a )
by Tomáš
12s
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 13

Duplication

Lines 18
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 18
loc 18
ccs 0
cts 15
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 13
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is a part of Sculpin.
5
 *
6
 * (c) Dragonfly Development Inc.
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 Symplify\PHP7_Sculpin\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17 View Code Duplication
final class Configuration implements ConfigurationInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function getConfigTreeBuilder()
23
    {
24
        $treeBuilder = new TreeBuilder();
25
26
        $rootNode = $treeBuilder->root('sculpin');
27
28
        $rootNode
29
            ->children()
30
                ->scalarNode('source_dir')->defaultValue('%sculpin.project_dir%/source')->end()
31
                ->scalarNode('output_dir')->defaultValue('%sculpin.project_dir%/output')->end()
32
                ->arrayNode('raw')
33
                    ->prototype('scalar')->end()
34
                ->end()
35
                ->scalarNode('permalink')->defaultValue('pretty')->end()
36
            ->end();
37
38
        return $treeBuilder;
39
    }
40
}
41