StepSetEnv   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getCommand() 0 10 1
1
<?php
2
/**
3
 * Step to log off a Cloud Foundry instance.
4
 */
5
6
namespace Graviton\Deployment\Steps\CloudFoundry;
7
8
/**
9
 * @author   List of contributors <https://github.com/libgraviton/deploy-scripts/graphs/contributors>
10
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
11
 * @link     http://swisscom.ch
12
 */
13
final class StepSetEnv extends AbstractStep
14
{
15
    /** @var string  */
16
    private $envVarName;
17
18
    /** @var string  */
19
    private $envVarValue;
20
21
    /** @var string  */
22
    private $application;
23
24
    /**
25
     * @param array  $configuration Current application configuration.
26
     * @param string $application   Name of the CF-application (e.g. graviton-unstable-blue)
27
     * @param string $envVarName    Name of the environment variable to be set.
28
     * @param string $envVarValue   Content of the environment variable to be set.
29
     */
30 5
    public function __construct(array $configuration, $application, $envVarName, $envVarValue)
31
    {
32 5
        parent::__construct($configuration);
33
34 5
        $this->envVarName = $envVarName;
35 5
        $this->envVarValue = $envVarValue;
36 5
        $this->application = $application;
37 5
    }
38
39
40
    /**
41
     * returns the command
42
     *
43
     * @return array
44
     */
45 4
    public function getCommand()
46
    {
47
        return array(
48 4
            $this->configuration['cf_bin'],
49 4
            'set-env',
50 4
            $this->application,
51 4
            $this->envVarName,
52 4
            $this->envVarValue
53 4
        );
54
    }
55
}
56