Deployment::getCurrentVersion()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace ParityBit\DeploymentNotifier;
4
5
use ParityBit\DeploymentNotifier\ChangeInspectors\ChangeInspector;
6
7
class Deployment
8
{
9
    protected $environment;
10
    protected $previousVersion;
11
    protected $currentVersion;
12
    protected $changes = null;
13
    protected $server;
14
    protected $changeInspector;
15
16
    public function __construct(
17
        Environment $environment,
18
        Version $previousVersion,
19
        Version $currentVersion,
20
        Server $server,
21
        ChangeInspector $changeInspector)
22
    {
23
        $this->environment = $environment;
24
        $this->previousVersion = $previousVersion;
25
        $this->currentVersion = $currentVersion;
26
        $this->server = $server;
27
        $this->changeInspector = $changeInspector;
28
    }
29
30
    public function getEnvironment()
31
    {
32
        return $this->environment;
33
    }
34
35
    public function getPreviousVersion()
36
    {
37
        return $this->previousVersion;
38
    }
39
40
    public function getCurrentVersion()
41
    {
42
        return $this->currentVersion;
43
    }
44
45
    public function getServer()
46
    {
47
        return $this->server;
48
    }
49
50
    public function getChanges()
51
    {
52
        if (is_null($this->changes)) {
53
            $this->changes = $this->changeInspector->getChangesFromDeployment($this);
54
        }
55
56
        return $this->changes;
57
    }
58
}
59