AbstractCommonStep   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 42
ccs 10
cts 10
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getCommand() 0 8 1
1
<?php
2
/**
3
 *  Common step for cf commands with no arguments
4
 */
5
6
namespace Graviton\Deployment\Steps\CloudFoundry;
7
8
use Graviton\Deployment\Steps\StepInterface;
9
10
/**
11
 * @author   List of contributors <https://github.com/libgraviton/deploy-scripts/graphs/contributors>
12
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
13
 * @link     http://swisscom.ch
14
 */
15
abstract class AbstractCommonStep extends AbstractStep
16
{
17
18
    /** @var string */
19
    private $slice;
20
21
    /** @var string */
22
    private $applicationName;
23
24
    /** @var string Name of the step to be registered. */
25
    protected static $stepName;
26
27
    /**
28
     *
29
     * @param array  $configuration   Current application configuration.
30
     * @param string $applicationName Name of the CF-application to be checked
31
     * @param string $slice           deployment location in blue/green deployment.
32
     *
33
     * @link http://martinfowler.com/bliki/BlueGreenDeployment.html
34
     */
35 12
    public function __construct(array $configuration, $applicationName, $slice)
36
    {
37 12
        parent::__construct($configuration);
38
39 12
        $this->slice = $slice;
40 12
        $this->applicationName = $applicationName;
41 12
    }
42
43
    /**
44
     * returns the command
45
     *
46
     * @return array
47
     */
48 7
    public function getCommand()
49
    {
50
        return array(
51 7
            $this->configuration['cf_bin'],
52 7
            static::$stepName,
53 7
            $this->applicationName . '-' . $this->slice
54 7
        );
55
    }
56
}
57