1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace ApiClients\Client\Github\Resource; |
4
|
|
|
|
5
|
|
|
use ApiClients\Foundation\Hydrator\Annotations\EmptyResource; |
6
|
|
|
use ApiClients\Foundation\Hydrator\Annotations\Nested; |
7
|
|
|
use ApiClients\Foundation\Resource\AbstractResource; |
8
|
|
|
use DateTimeInterface; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @Nested( |
12
|
|
|
* owner="User" |
13
|
|
|
* ) |
14
|
|
|
* @EmptyResource("EmptyRepository") |
15
|
|
|
*/ |
16
|
|
|
abstract class Repository extends AbstractResource implements RepositoryInterface |
17
|
|
|
{ |
18
|
|
|
/** |
19
|
|
|
* @var int |
20
|
|
|
*/ |
21
|
|
|
protected $id; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var string |
25
|
|
|
*/ |
26
|
|
|
protected $name; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var string |
30
|
|
|
*/ |
31
|
|
|
protected $full_name; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var string |
35
|
|
|
*/ |
36
|
|
|
protected $url; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var string |
40
|
|
|
*/ |
41
|
|
|
protected $description; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var bool |
45
|
|
|
*/ |
46
|
|
|
protected $private; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var bool |
50
|
|
|
*/ |
51
|
|
|
protected $fork; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @var string |
55
|
|
|
*/ |
56
|
|
|
protected $homepage; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @var string |
60
|
|
|
*/ |
61
|
|
|
protected $language; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @var int |
65
|
|
|
*/ |
66
|
|
|
protected $forks_count; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @var int |
70
|
|
|
*/ |
71
|
|
|
protected $stargazers_count; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @var int |
75
|
|
|
*/ |
76
|
|
|
protected $watchers_count; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @var int |
80
|
|
|
*/ |
81
|
|
|
protected $size; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @var string |
85
|
|
|
*/ |
86
|
|
|
protected $default_branch; |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @var int |
90
|
|
|
*/ |
91
|
|
|
protected $open_issues_count; |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @var bool |
95
|
|
|
*/ |
96
|
|
|
protected $has_issues; |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @var bool |
100
|
|
|
*/ |
101
|
|
|
protected $has_wiki; |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @var bool |
105
|
|
|
*/ |
106
|
|
|
protected $has_pages; |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @var bool |
110
|
|
|
*/ |
111
|
|
|
protected $has_downloads; |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @var DateTimeInterface |
115
|
|
|
*/ |
116
|
|
|
protected $pushed_at; |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* @var DateTimeInterface |
120
|
|
|
*/ |
121
|
|
|
protected $created_at; |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @var DateTimeInterface |
125
|
|
|
*/ |
126
|
|
|
protected $updated_at; |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* @var array |
130
|
|
|
*/ |
131
|
|
|
protected $permissions; |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* @var string |
135
|
|
|
*/ |
136
|
|
|
protected $html_url; |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* @var User |
140
|
|
|
*/ |
141
|
|
|
protected $owner; |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @return int |
145
|
|
|
*/ |
146
|
4 |
|
public function id() : int |
147
|
|
|
{ |
148
|
4 |
|
return $this->id; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @return string |
153
|
|
|
*/ |
154
|
4 |
|
public function name() : string |
155
|
|
|
{ |
156
|
4 |
|
return $this->name; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* @return string |
161
|
|
|
*/ |
162
|
4 |
|
public function fullName() : string |
163
|
|
|
{ |
164
|
4 |
|
return $this->full_name; |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* @return string |
169
|
|
|
*/ |
170
|
4 |
|
public function url() : string |
171
|
|
|
{ |
172
|
4 |
|
return $this->url; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* @return string |
177
|
|
|
*/ |
178
|
4 |
|
public function description() : string |
179
|
|
|
{ |
180
|
4 |
|
return (string)$this->description; |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* @return bool |
185
|
|
|
*/ |
186
|
4 |
|
public function private() : bool |
187
|
|
|
{ |
188
|
4 |
|
return $this->private; |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* @return bool |
193
|
|
|
*/ |
194
|
4 |
|
public function fork() : bool |
195
|
|
|
{ |
196
|
4 |
|
return $this->fork; |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* @return string |
201
|
|
|
*/ |
202
|
4 |
|
public function homepage() : string |
203
|
|
|
{ |
204
|
4 |
|
return $this->homepage; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* @return string |
209
|
|
|
*/ |
210
|
4 |
|
public function language() : string |
211
|
|
|
{ |
212
|
4 |
|
return $this->language; |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* @return int |
217
|
|
|
*/ |
218
|
4 |
|
public function forksCount() : int |
219
|
|
|
{ |
220
|
4 |
|
return $this->forks_count; |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
/** |
224
|
|
|
* @return int |
225
|
|
|
*/ |
226
|
4 |
|
public function stargazersCount() : int |
227
|
|
|
{ |
228
|
4 |
|
return $this->stargazers_count; |
229
|
|
|
} |
230
|
|
|
|
231
|
|
|
/** |
232
|
|
|
* @return int |
233
|
|
|
*/ |
234
|
4 |
|
public function watchersCount() : int |
235
|
|
|
{ |
236
|
4 |
|
return $this->watchers_count; |
237
|
|
|
} |
238
|
|
|
|
239
|
|
|
/** |
240
|
|
|
* @return int |
241
|
|
|
*/ |
242
|
4 |
|
public function size() : int |
243
|
|
|
{ |
244
|
4 |
|
return $this->size; |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
/** |
248
|
|
|
* @return string |
249
|
|
|
*/ |
250
|
4 |
|
public function defaultBranch() : string |
251
|
|
|
{ |
252
|
4 |
|
return $this->default_branch; |
253
|
|
|
} |
254
|
|
|
|
255
|
|
|
/** |
256
|
|
|
* @return int |
257
|
|
|
*/ |
258
|
4 |
|
public function openIssuesCount() : int |
259
|
|
|
{ |
260
|
4 |
|
return $this->open_issues_count; |
261
|
|
|
} |
262
|
|
|
|
263
|
|
|
/** |
264
|
|
|
* @return bool |
265
|
|
|
*/ |
266
|
4 |
|
public function hasIssues() : bool |
267
|
|
|
{ |
268
|
4 |
|
return $this->has_issues; |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
/** |
272
|
|
|
* @return bool |
273
|
|
|
*/ |
274
|
4 |
|
public function hasWiki() : bool |
275
|
|
|
{ |
276
|
4 |
|
return $this->has_wiki; |
277
|
|
|
} |
278
|
|
|
|
279
|
|
|
/** |
280
|
|
|
* @return bool |
281
|
|
|
*/ |
282
|
4 |
|
public function hasPages() : bool |
283
|
|
|
{ |
284
|
4 |
|
return $this->has_pages; |
285
|
|
|
} |
286
|
|
|
|
287
|
|
|
/** |
288
|
|
|
* @return bool |
289
|
|
|
*/ |
290
|
4 |
|
public function hasDownloads() : bool |
291
|
|
|
{ |
292
|
4 |
|
return $this->has_downloads; |
293
|
|
|
} |
294
|
|
|
|
295
|
|
|
/** |
296
|
|
|
* @return DateTimeInterface |
297
|
|
|
*/ |
298
|
|
|
public function pushedAt() : DateTimeInterface |
299
|
|
|
{ |
300
|
|
|
return $this->pushed_at; |
301
|
|
|
} |
302
|
|
|
|
303
|
|
|
/** |
304
|
|
|
* @return DateTimeInterface |
305
|
|
|
*/ |
306
|
|
|
public function createdAt() : DateTimeInterface |
307
|
|
|
{ |
308
|
|
|
return $this->created_at; |
309
|
|
|
} |
310
|
|
|
|
311
|
|
|
/** |
312
|
|
|
* @return DateTimeInterface |
313
|
|
|
*/ |
314
|
|
|
public function updatedAt() : DateTimeInterface |
315
|
|
|
{ |
316
|
|
|
return $this->updated_at; |
317
|
|
|
} |
318
|
|
|
|
319
|
|
|
/** |
320
|
|
|
* @return array |
321
|
|
|
*/ |
322
|
|
|
public function permissions() : array |
323
|
|
|
{ |
324
|
|
|
return $this->permissions; |
325
|
|
|
} |
326
|
|
|
|
327
|
|
|
/** |
328
|
|
|
* @return string |
329
|
|
|
*/ |
330
|
4 |
|
public function htmlUrl() : string |
331
|
|
|
{ |
332
|
4 |
|
return $this->html_url; |
333
|
|
|
} |
334
|
|
|
|
335
|
|
|
/** |
336
|
|
|
* @return User |
337
|
|
|
*/ |
338
|
|
|
public function owner() : User |
339
|
|
|
{ |
340
|
|
|
return $this->owner; |
341
|
|
|
} |
342
|
|
|
} |
343
|
|
|
|