|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
|
|
3
|
|
|
namespace WyriHaximus\Travis\Resource; |
|
4
|
|
|
|
|
5
|
|
|
use ApiClients\Foundation\Hydrator\Annotations\EmptyResource; |
|
6
|
|
|
use ApiClients\Foundation\Resource\AbstractResource; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* @EmptyResource("EmptyRepository") |
|
10
|
|
|
*/ |
|
11
|
|
|
abstract class Repository extends AbstractResource implements RepositoryInterface |
|
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 int |
|
50
|
|
|
*/ |
|
51
|
|
|
protected $last_build_started_at; |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @var int |
|
55
|
|
|
*/ |
|
56
|
|
|
protected $last_build_finished_at; |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @var string |
|
60
|
|
|
*/ |
|
61
|
|
|
protected $github_language; |
|
62
|
|
|
|
|
63
|
2 |
|
/** |
|
64
|
|
|
* @return int |
|
65
|
2 |
|
*/ |
|
66
|
|
|
public function id() : int |
|
67
|
|
|
{ |
|
68
|
2 |
|
return $this->id; |
|
69
|
|
|
} |
|
70
|
2 |
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* @return string |
|
73
|
2 |
|
*/ |
|
74
|
|
|
public function slug() : string |
|
75
|
2 |
|
{ |
|
76
|
|
|
return $this->slug; |
|
77
|
|
|
} |
|
78
|
2 |
|
|
|
79
|
|
|
/** |
|
80
|
2 |
|
* @return string |
|
81
|
|
|
*/ |
|
82
|
|
|
public function description() : string |
|
83
|
2 |
|
{ |
|
84
|
|
|
return $this->description; |
|
85
|
2 |
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
2 |
|
* @return int |
|
89
|
|
|
*/ |
|
90
|
2 |
|
public function lastBuildId() : int |
|
91
|
|
|
{ |
|
92
|
|
|
return (int)$this->last_build_id; |
|
93
|
2 |
|
} |
|
94
|
|
|
|
|
95
|
2 |
|
/** |
|
96
|
|
|
* @return int |
|
97
|
|
|
*/ |
|
98
|
2 |
|
public function lastBuildNumber() : int |
|
99
|
|
|
{ |
|
100
|
2 |
|
return $this->last_build_number; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
2 |
|
/** |
|
104
|
|
|
* @return string |
|
105
|
2 |
|
*/ |
|
106
|
|
|
public function lastBuildState() : string |
|
107
|
|
|
{ |
|
108
|
2 |
|
return $this->last_build_state; |
|
109
|
|
|
} |
|
110
|
2 |
|
|
|
111
|
|
|
/** |
|
112
|
|
|
* @return int |
|
113
|
|
|
*/ |
|
114
|
|
|
public function lastBuildDuration() : int |
|
115
|
|
|
{ |
|
116
|
|
|
return $this->last_build_duration; |
|
117
|
|
|
} |
|
118
|
|
|
|
|
119
|
|
|
/** |
|
120
|
|
|
* @return int |
|
121
|
|
|
*/ |
|
122
|
|
|
public function lastBuildStartedAt() : int |
|
123
|
|
|
{ |
|
124
|
|
|
return $this->last_build_started_at; |
|
125
|
|
|
} |
|
126
|
|
|
|
|
127
|
|
|
/** |
|
128
|
|
|
* @return int |
|
129
|
|
|
*/ |
|
130
|
|
|
public function lastBuildFinishedAt() : int |
|
131
|
|
|
{ |
|
132
|
|
|
return $this->last_build_finished_at; |
|
133
|
|
|
} |
|
134
|
|
|
|
|
135
|
|
|
/** |
|
136
|
|
|
* @return string |
|
137
|
|
|
*/ |
|
138
|
|
|
public function githubLanguage() : string |
|
139
|
|
|
{ |
|
140
|
|
|
return $this->github_language; |
|
141
|
|
|
} |
|
142
|
|
|
} |
|
143
|
|
|
|