1
|
|
|
<?php |
2
|
|
|
namespace DevBoardLib\GithubCore\CommitStatus; |
3
|
|
|
|
4
|
|
|
use DateTime; |
5
|
|
|
use DevBoardLib\GithubCore\Commit\GithubCommit; |
6
|
|
|
use DevBoardLib\GithubCore\Commit\GithubCommitId; |
7
|
|
|
use DevBoardLib\GithubCore\CommitStatus\State\GithubCommitStatusState; |
8
|
|
|
use DevBoardLib\GithubCore\External\ExternalService; |
9
|
|
|
use DevBoardLib\GithubCore\External\ExternalServiceId; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Class GithubCommitStatusSource. |
13
|
|
|
*/ |
14
|
|
|
class GithubCommitStatusSource implements GithubCommitStatus |
15
|
|
|
{ |
16
|
|
|
/** @var GithubCommitStatusId */ |
17
|
|
|
private $lastReceivedGithubStatusId; |
18
|
|
|
/** @var GithubCommitId */ |
19
|
|
|
private $githubCommitId; |
20
|
|
|
/** @var ExternalServiceId */ |
21
|
|
|
private $githubExternalServiceId; |
22
|
|
|
/** @var string */ |
23
|
|
|
private $description; |
24
|
|
|
/** @var string */ |
25
|
|
|
private $targetUrl; |
26
|
|
|
/** @var GithubCommitStatusState */ |
27
|
|
|
private $githubState; |
28
|
|
|
/** @var DateTime */ |
29
|
|
|
private $githubCreatedAt; |
30
|
|
|
/** @var DateTime */ |
31
|
|
|
private $githubUpdatedAt; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* GithubCommitStatusSource constructor. |
35
|
|
|
* |
36
|
|
|
* @param GithubCommitStatusId $lastReceivedGithubStatusId |
37
|
|
|
* @param GithubCommitId $githubCommitId |
38
|
|
|
* @param ExternalServiceId $githubExternalServiceId |
39
|
|
|
* @param string $description |
40
|
|
|
* @param string $targetUrl |
41
|
|
|
* @param GithubCommitStatusState $githubState |
42
|
|
|
* @param DateTime $githubCreatedAt |
43
|
|
|
* @param DateTime $githubUpdatedAt |
44
|
|
|
*/ |
45
|
|
|
public function __construct( |
46
|
|
|
GithubCommitStatusId $lastReceivedGithubStatusId, |
47
|
|
|
GithubCommitId $githubCommitId, |
48
|
|
|
ExternalServiceId $githubExternalServiceId, |
49
|
|
|
$description, |
50
|
|
|
$targetUrl, |
51
|
|
|
GithubCommitStatusState $githubState, |
52
|
|
|
DateTime $githubCreatedAt, |
53
|
|
|
DateTime $githubUpdatedAt |
54
|
|
|
) { |
55
|
|
|
$this->lastReceivedGithubStatusId = $lastReceivedGithubStatusId; |
56
|
|
|
$this->githubCommitId = $githubCommitId; |
57
|
|
|
$this->githubExternalServiceId = $githubExternalServiceId; |
58
|
|
|
$this->description = $description; |
59
|
|
|
$this->targetUrl = $targetUrl; |
60
|
|
|
$this->githubState = $githubState; |
61
|
|
|
$this->githubCreatedAt = $githubCreatedAt; |
62
|
|
|
$this->githubUpdatedAt = $githubUpdatedAt; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @return GithubCommitStatusId |
67
|
|
|
*/ |
68
|
|
|
public function getLastReceivedGithubStatusId() |
69
|
|
|
{ |
70
|
|
|
return $this->lastReceivedGithubStatusId; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** @return GithubCommitId */ |
74
|
|
|
public function getGithubCommitId() |
75
|
|
|
{ |
76
|
|
|
return $this->githubCommitId; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** @return ExternalServiceId */ |
80
|
|
|
public function getGithubExternalServiceId() |
81
|
|
|
{ |
82
|
|
|
return $this->githubExternalServiceId; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** @return string */ |
86
|
|
|
public function getDescription() |
87
|
|
|
{ |
88
|
|
|
return $this->description; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** @return string */ |
92
|
|
|
public function getTargetUrl() |
93
|
|
|
{ |
94
|
|
|
return $this->targetUrl; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** @return GithubCommitStatusState */ |
98
|
|
|
public function getGithubState() |
99
|
|
|
{ |
100
|
|
|
return $this->githubState; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** @return DateTime */ |
104
|
|
|
public function getGithubCreatedAt() |
105
|
|
|
{ |
106
|
|
|
return $this->githubCreatedAt; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** @return DateTime */ |
110
|
|
|
public function getGithubUpdatedAt() |
111
|
|
|
{ |
112
|
|
|
return $this->githubUpdatedAt; |
113
|
|
|
} |
114
|
|
|
} |
115
|
|
|
|