StrategiesDefinition::getChildren()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 29

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 24
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 31
ccs 24
cts 24
cp 1
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 29
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of Rocketeer
5
 *
6
 * (c) Maxime Fabre <[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
13
namespace Rocketeer\Services\Config\Definition;
14
15
use Symfony\Component\Config\Definition\TreeBuilder\NodeBuilder;
16
17
/**
18
 * Configuration schema for the strategies node.
19
 */
20
class StrategiesDefinition extends AbstractDefinition
21
{
22
    /**
23
     * @var string
24
     */
25
    protected $name = 'strategies';
26
27
    /**
28
     * @var string
29
     */
30
    protected $description = 'Here you can configure in a modular way which tasks to use to execute various core parts of your deployment\'s flow';
31
32
    /**
33
     * @param NodeBuilder $node
34
     *
35
     * @return NodeBuilder
36
     */
37 21
    protected function getChildren(NodeBuilder $node)
38
    {
39
        return $node
40 21
            ->scalarNode('check')
41 21
                ->info('Which strategy to use to check the server')
42 21
                ->defaultValue('Polyglot')
43 21
            ->end()
44 21
            ->scalarNode('create-release')
45 21
                ->info('Which strategy to use to create a new release and prepare its dependencies')
46 21
                ->defaultValue('Clone')
47 21
            ->end()
48 21
            ->scalarNode('deploy')
49 21
                ->info('Which strategy to use to send a release online')
50 21
                ->defaultValue('Rolling')
51 21
            ->end()
52 21
            ->scalarNode('rollback')
53 21
                ->info('Which strategy to use to rollback to a previous release')
54 21
                ->defaultValue('Rolling')
55 21
            ->end()
56 21
            ->scalarNode('test')
57 21
                ->info('Which strategy to use to test your application')
58 21
                ->defaultValue('Phpunit')
59 21
            ->end()
60 21
            ->scalarNode('migrate')
61 21
                ->info('Which strategy to use to migrate your database')
62 21
            ->end()
63
            ->scalarNode('dependencies')
64
                ->info("Which strategy to use to install your application's dependencies")
65
                ->defaultValue('Polyglot')
66
            ->end();
67
    }
68
}
69