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