StepBindService   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 3
Bugs 0 Features 1
Metric Value
wmc 2
c 3
b 0
f 1
lcom 1
cbo 1
dl 0
loc 43
ccs 12
cts 12
cp 1
rs 10

2 Methods

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