PhingTaskConfiguration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 27
ccs 0
cts 17
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 24 1
1
<?php
2
3
/*
4
 * This file is part of the Conveyor package.
5
 *
6
 * (c) Jeroen Fiege <[email protected]>
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 Webcreate\Conveyor\Task\Configuration;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
class PhingTaskConfiguration implements ConfigurationInterface
18
{
19
    public function getConfigTreeBuilder()
20
    {
21
        $treeBuilder = new TreeBuilder();
22
        $rootNode = $treeBuilder->root('task');
23
24
        $rootNode
25
            ->children()
26
                ->scalarNode('buildfile')->defaultNull()->end()
27
                ->arrayNode('target')
28
                    ->isRequired()
29
                    ->requiresAtLeastOneElement()
30
                    ->prototype('scalar')->end()
31
                    ->beforeNormalization()
32
                        ->ifString()
33
                        ->then(function ($v) {
34
                            return array($v);
35
                        })
36
                    ->end()
37
                ->end()
38
            ->end()
39
        ;
40
41
        return $treeBuilder;
42
    }
43
}
44