1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
namespace WyriHaximus\Travis\Resource; |
5
|
|
|
|
6
|
|
|
use DateTimeInterface; |
7
|
|
|
use WyriHaximus\ApiClient\Resource\TransportAwareTrait; |
8
|
|
|
|
9
|
|
|
abstract class Repository implements RepositoryInterface |
10
|
|
|
{ |
11
|
|
|
use TransportAwareTrait; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* @var int |
15
|
|
|
*/ |
16
|
|
|
protected $id; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @var string |
20
|
|
|
*/ |
21
|
|
|
protected $slug; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var string |
25
|
|
|
*/ |
26
|
|
|
protected $description; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var int |
30
|
|
|
*/ |
31
|
|
|
protected $last_build_id; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var int |
35
|
|
|
*/ |
36
|
|
|
protected $last_build_number; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var string |
40
|
|
|
*/ |
41
|
|
|
protected $last_build_state; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var int |
45
|
|
|
*/ |
46
|
|
|
protected $last_build_duration; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var DateTimeInterface |
50
|
|
|
*/ |
51
|
|
|
protected $last_build_started_at; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @var DateTimeInterface |
55
|
|
|
*/ |
56
|
|
|
protected $last_build_finished_at; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @var string |
60
|
|
|
*/ |
61
|
|
|
protected $github_language; |
62
|
|
|
|
63
|
2 |
|
public function id() : int |
64
|
|
|
{ |
65
|
2 |
|
return $this->id; |
66
|
|
|
} |
67
|
|
|
|
68
|
2 |
|
public function slug() : string |
69
|
|
|
{ |
70
|
2 |
|
return $this->slug; |
71
|
|
|
} |
72
|
|
|
|
73
|
2 |
|
public function description() : string |
74
|
|
|
{ |
75
|
2 |
|
return $this->description; |
76
|
|
|
} |
77
|
|
|
|
78
|
2 |
|
public function lastBuildId() : int |
79
|
|
|
{ |
80
|
2 |
|
return $this->last_build_id; |
81
|
|
|
} |
82
|
|
|
|
83
|
2 |
|
public function lastBuildNumber() : int |
84
|
|
|
{ |
85
|
2 |
|
return $this->last_build_number; |
86
|
|
|
} |
87
|
|
|
|
88
|
2 |
|
public function lastBuildState() : string |
89
|
|
|
{ |
90
|
2 |
|
return $this->last_build_state; |
91
|
|
|
} |
92
|
|
|
|
93
|
2 |
|
public function lastBuildDuration() : int |
94
|
|
|
{ |
95
|
2 |
|
return $this->last_build_duration; |
96
|
|
|
} |
97
|
|
|
|
98
|
2 |
|
public function lastBuildStartedAt() : DateTimeInterface |
99
|
|
|
{ |
100
|
2 |
|
return $this->last_build_started_at; |
101
|
|
|
} |
102
|
|
|
|
103
|
2 |
|
public function lastBuildFinishedAt() : DateTimeInterface |
104
|
|
|
{ |
105
|
2 |
|
return $this->last_build_finished_at; |
106
|
|
|
} |
107
|
|
|
|
108
|
2 |
|
public function githubLanguage() : string |
109
|
|
|
{ |
110
|
2 |
|
return $this->github_language; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
public function refresh() |
114
|
|
|
{ |
115
|
|
|
// TODO |
116
|
|
|
} |
117
|
|
|
} |
118
|
|
|
|