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