1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace ApiClients\Client\Github\Resource\Repository; |
4
|
|
|
|
5
|
|
|
use ApiClients\Foundation\Hydrator\Annotation\Collection; |
6
|
|
|
use ApiClients\Foundation\Hydrator\Annotation\EmptyResource; |
7
|
|
|
use ApiClients\Foundation\Hydrator\Annotation\Nested; |
8
|
|
|
use ApiClients\Foundation\Resource\AbstractResource; |
9
|
|
|
use DateTimeInterface; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* @Collection( |
13
|
|
|
* labels="Label", |
14
|
|
|
* assignees="User", |
15
|
|
|
* requested_reviewers="User" |
16
|
|
|
* ) |
17
|
|
|
* @Nested( |
18
|
|
|
* user="User", |
19
|
|
|
* milestone="Repository\Milestone", |
20
|
|
|
* assignee="User", |
21
|
|
|
* head="Repository\PullRequest\Rb", |
22
|
|
|
* base="Repository\PullRequest\Rb", |
23
|
|
|
* merged_by="User" |
24
|
|
|
* ) |
25
|
|
|
* @EmptyResource("Repository\EmptyPullRequest") |
26
|
|
|
*/ |
27
|
|
|
abstract class PullRequest extends AbstractResource implements PullRequestInterface |
28
|
|
|
{ |
29
|
|
|
/** |
30
|
|
|
* @var string |
31
|
|
|
*/ |
32
|
|
|
protected $url; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var int |
36
|
|
|
*/ |
37
|
|
|
protected $id; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var string |
41
|
|
|
*/ |
42
|
|
|
protected $html_url; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @var int |
46
|
|
|
*/ |
47
|
|
|
protected $number; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @var string |
51
|
|
|
*/ |
52
|
|
|
protected $state; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @var bool |
56
|
|
|
*/ |
57
|
|
|
protected $locked; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @var string |
61
|
|
|
*/ |
62
|
|
|
protected $title; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @var User |
66
|
|
|
*/ |
67
|
|
|
protected $user; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @var string |
71
|
|
|
*/ |
72
|
|
|
protected $body; |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @var Label |
76
|
|
|
*/ |
77
|
|
|
protected $labels; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @var Repository\Milestone |
81
|
|
|
*/ |
82
|
|
|
protected $milestone; |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @var string |
86
|
|
|
*/ |
87
|
|
|
protected $active_lock_reason; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @var DateTimeInterface |
91
|
|
|
*/ |
92
|
|
|
protected $created_at; |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @var DateTimeInterface |
96
|
|
|
*/ |
97
|
|
|
protected $updated_at; |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @var DateTimeInterface |
101
|
|
|
*/ |
102
|
|
|
protected $closed_at; |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @var DateTimeInterface |
106
|
|
|
*/ |
107
|
|
|
protected $merged_at; |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @var string |
111
|
|
|
*/ |
112
|
|
|
protected $merge_commit_sha; |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @var User |
116
|
|
|
*/ |
117
|
|
|
protected $assignee; |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* @var User |
121
|
|
|
*/ |
122
|
|
|
protected $assignees; |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @var User |
126
|
|
|
*/ |
127
|
|
|
protected $requested_reviewers; |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* @var Repository\PullRequest\Rb |
131
|
|
|
*/ |
132
|
|
|
protected $head; |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @var Repository\PullRequest\Rb |
136
|
|
|
*/ |
137
|
|
|
protected $base; |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @var string |
141
|
|
|
*/ |
142
|
|
|
protected $author_association; |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @var bool |
146
|
|
|
*/ |
147
|
|
|
protected $draft; |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* @var bool |
151
|
|
|
*/ |
152
|
|
|
protected $merged; |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @var bool |
156
|
|
|
*/ |
157
|
|
|
protected $mergeable; |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* @var bool |
161
|
|
|
*/ |
162
|
|
|
protected $rebaseable; |
163
|
|
|
|
164
|
|
|
/** |
165
|
|
|
* @var string |
166
|
|
|
*/ |
167
|
|
|
protected $mergeable_state; |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* @var User |
171
|
|
|
*/ |
172
|
|
|
protected $merged_by; |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* @var int |
176
|
|
|
*/ |
177
|
|
|
protected $comments; |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* @var int |
181
|
|
|
*/ |
182
|
|
|
protected $review_comments; |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* @var bool |
186
|
|
|
*/ |
187
|
|
|
protected $maintainer_can_modify; |
188
|
|
|
|
189
|
|
|
/** |
190
|
|
|
* @var int |
191
|
|
|
*/ |
192
|
|
|
protected $commits; |
193
|
|
|
|
194
|
|
|
/** |
195
|
|
|
* @var int |
196
|
|
|
*/ |
197
|
|
|
protected $additions; |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* @var int |
201
|
|
|
*/ |
202
|
|
|
protected $deletions; |
203
|
|
|
|
204
|
|
|
/** |
205
|
|
|
* @var int |
206
|
|
|
*/ |
207
|
|
|
protected $changed_files; |
208
|
|
|
|
209
|
|
|
/** |
210
|
|
|
* @return string |
211
|
|
|
*/ |
212
|
|
|
public function url(): string |
213
|
|
|
{ |
214
|
|
|
return $this->url; |
215
|
|
|
} |
216
|
|
|
|
217
|
|
|
/** |
218
|
|
|
* @return int |
219
|
|
|
*/ |
220
|
|
|
public function id(): int |
221
|
|
|
{ |
222
|
|
|
return $this->id; |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
/** |
226
|
|
|
* @return string |
227
|
|
|
*/ |
228
|
|
|
public function htmlUrl(): string |
229
|
|
|
{ |
230
|
|
|
return $this->html_url; |
231
|
|
|
} |
232
|
|
|
|
233
|
|
|
/** |
234
|
|
|
* @return int |
235
|
|
|
*/ |
236
|
|
|
public function number(): int |
237
|
|
|
{ |
238
|
|
|
return $this->number; |
239
|
|
|
} |
240
|
|
|
|
241
|
|
|
/** |
242
|
|
|
* @return string |
243
|
|
|
*/ |
244
|
|
|
public function state(): string |
245
|
|
|
{ |
246
|
|
|
return $this->state; |
247
|
|
|
} |
248
|
|
|
|
249
|
|
|
/** |
250
|
|
|
* @return bool |
251
|
|
|
*/ |
252
|
|
|
public function locked(): bool |
253
|
|
|
{ |
254
|
|
|
return $this->locked; |
255
|
|
|
} |
256
|
|
|
|
257
|
|
|
/** |
258
|
|
|
* @return string |
259
|
|
|
*/ |
260
|
|
|
public function title(): string |
261
|
|
|
{ |
262
|
|
|
return $this->title; |
263
|
|
|
} |
264
|
|
|
|
265
|
|
|
/** |
266
|
|
|
* @return User |
267
|
|
|
*/ |
268
|
|
|
public function user(): User |
269
|
|
|
{ |
270
|
|
|
return $this->user; |
271
|
|
|
} |
272
|
|
|
|
273
|
|
|
/** |
274
|
|
|
* @return string |
275
|
|
|
*/ |
276
|
|
|
public function body(): string |
277
|
|
|
{ |
278
|
|
|
return $this->body; |
279
|
|
|
} |
280
|
|
|
|
281
|
|
|
/** |
282
|
|
|
* @return Label |
283
|
|
|
*/ |
284
|
|
|
public function labels(): Label |
285
|
|
|
{ |
286
|
|
|
return $this->labels; |
287
|
|
|
} |
288
|
|
|
|
289
|
|
|
/** |
290
|
|
|
* @return Repository\Milestone |
291
|
|
|
*/ |
292
|
|
|
public function milestone(): Repository\Milestone |
293
|
|
|
{ |
294
|
|
|
return $this->milestone; |
295
|
|
|
} |
296
|
|
|
|
297
|
|
|
/** |
298
|
|
|
* @return string |
299
|
|
|
*/ |
300
|
|
|
public function activeLockReason(): string |
301
|
|
|
{ |
302
|
|
|
return $this->active_lock_reason; |
303
|
|
|
} |
304
|
|
|
|
305
|
|
|
/** |
306
|
|
|
* @return DateTimeInterface |
307
|
|
|
*/ |
308
|
|
|
public function createdAt(): DateTimeInterface |
309
|
|
|
{ |
310
|
|
|
return $this->created_at; |
311
|
|
|
} |
312
|
|
|
|
313
|
|
|
/** |
314
|
|
|
* @return DateTimeInterface |
315
|
|
|
*/ |
316
|
|
|
public function updatedAt(): DateTimeInterface |
317
|
|
|
{ |
318
|
|
|
return $this->updated_at; |
319
|
|
|
} |
320
|
|
|
|
321
|
|
|
/** |
322
|
|
|
* @return DateTimeInterface |
323
|
|
|
*/ |
324
|
|
|
public function closedAt(): DateTimeInterface |
325
|
|
|
{ |
326
|
|
|
return $this->closed_at; |
327
|
|
|
} |
328
|
|
|
|
329
|
|
|
/** |
330
|
|
|
* @return DateTimeInterface |
331
|
|
|
*/ |
332
|
|
|
public function mergedAt(): DateTimeInterface |
333
|
|
|
{ |
334
|
|
|
return $this->merged_at; |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
/** |
338
|
|
|
* @return string |
339
|
|
|
*/ |
340
|
|
|
public function mergeCommitSha(): string |
341
|
|
|
{ |
342
|
|
|
return $this->merge_commit_sha; |
343
|
|
|
} |
344
|
|
|
|
345
|
|
|
/** |
346
|
|
|
* @return User |
347
|
|
|
*/ |
348
|
|
|
public function assignee(): User |
349
|
|
|
{ |
350
|
|
|
return $this->assignee; |
351
|
|
|
} |
352
|
|
|
|
353
|
|
|
/** |
354
|
|
|
* @return User |
355
|
|
|
*/ |
356
|
|
|
public function assignees(): User |
357
|
|
|
{ |
358
|
|
|
return $this->assignees; |
359
|
|
|
} |
360
|
|
|
|
361
|
|
|
/** |
362
|
|
|
* @return User |
363
|
|
|
*/ |
364
|
|
|
public function requestedReviewers(): User |
365
|
|
|
{ |
366
|
|
|
return $this->requested_reviewers; |
367
|
|
|
} |
368
|
|
|
|
369
|
|
|
/** |
370
|
|
|
* @return Repository\PullRequest\Rb |
371
|
|
|
*/ |
372
|
|
|
public function head(): Repository\PullRequest\Rb |
373
|
|
|
{ |
374
|
|
|
return $this->head; |
375
|
|
|
} |
376
|
|
|
|
377
|
|
|
/** |
378
|
|
|
* @return Repository\PullRequest\Rb |
379
|
|
|
*/ |
380
|
|
|
public function base(): Repository\PullRequest\Rb |
381
|
|
|
{ |
382
|
|
|
return $this->base; |
383
|
|
|
} |
384
|
|
|
|
385
|
|
|
/** |
386
|
|
|
* @return string |
387
|
|
|
*/ |
388
|
|
|
public function authorAssociation(): string |
389
|
|
|
{ |
390
|
|
|
return $this->author_association; |
391
|
|
|
} |
392
|
|
|
|
393
|
|
|
/** |
394
|
|
|
* @return bool |
395
|
|
|
*/ |
396
|
|
|
public function draft(): bool |
397
|
|
|
{ |
398
|
|
|
return $this->draft; |
399
|
|
|
} |
400
|
|
|
|
401
|
|
|
/** |
402
|
|
|
* @return bool |
403
|
|
|
*/ |
404
|
|
|
public function merged(): bool |
405
|
|
|
{ |
406
|
|
|
return $this->merged; |
407
|
|
|
} |
408
|
|
|
|
409
|
|
|
/** |
410
|
|
|
* @return bool |
411
|
|
|
*/ |
412
|
|
|
public function mergeable(): bool |
413
|
|
|
{ |
414
|
|
|
return $this->mergeable; |
415
|
|
|
} |
416
|
|
|
|
417
|
|
|
/** |
418
|
|
|
* @return bool |
419
|
|
|
*/ |
420
|
|
|
public function rebaseable(): bool |
421
|
|
|
{ |
422
|
|
|
return $this->rebaseable; |
423
|
|
|
} |
424
|
|
|
|
425
|
|
|
/** |
426
|
|
|
* @return string |
427
|
|
|
*/ |
428
|
|
|
public function mergeableState(): string |
429
|
|
|
{ |
430
|
|
|
return $this->mergeable_state; |
431
|
|
|
} |
432
|
|
|
|
433
|
|
|
/** |
434
|
|
|
* @return User |
435
|
|
|
*/ |
436
|
|
|
public function mergedBy(): User |
437
|
|
|
{ |
438
|
|
|
return $this->merged_by; |
439
|
|
|
} |
440
|
|
|
|
441
|
|
|
/** |
442
|
|
|
* @return int |
443
|
|
|
*/ |
444
|
|
|
public function comments(): int |
445
|
|
|
{ |
446
|
|
|
return $this->comments; |
447
|
|
|
} |
448
|
|
|
|
449
|
|
|
/** |
450
|
|
|
* @return int |
451
|
|
|
*/ |
452
|
|
|
public function reviewComments(): int |
453
|
|
|
{ |
454
|
|
|
return $this->review_comments; |
455
|
|
|
} |
456
|
|
|
|
457
|
|
|
/** |
458
|
|
|
* @return bool |
459
|
|
|
*/ |
460
|
|
|
public function maintainerCanModify(): bool |
461
|
|
|
{ |
462
|
|
|
return $this->maintainer_can_modify; |
463
|
|
|
} |
464
|
|
|
|
465
|
|
|
/** |
466
|
|
|
* @return int |
467
|
|
|
*/ |
468
|
|
|
public function commits(): int |
469
|
|
|
{ |
470
|
|
|
return $this->commits; |
471
|
|
|
} |
472
|
|
|
|
473
|
|
|
/** |
474
|
|
|
* @return int |
475
|
|
|
*/ |
476
|
|
|
public function additions(): int |
477
|
|
|
{ |
478
|
|
|
return $this->additions; |
479
|
|
|
} |
480
|
|
|
|
481
|
|
|
/** |
482
|
|
|
* @return int |
483
|
|
|
*/ |
484
|
|
|
public function deletions(): int |
485
|
|
|
{ |
486
|
|
|
return $this->deletions; |
487
|
|
|
} |
488
|
|
|
|
489
|
|
|
/** |
490
|
|
|
* @return int |
491
|
|
|
*/ |
492
|
|
|
public function changedFiles(): int |
493
|
|
|
{ |
494
|
|
|
return $this->changed_files; |
495
|
|
|
} |
496
|
|
|
} |
497
|
|
|
|