forked from kriskbx/gitlab-time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMergeRequest.php
More file actions
60 lines (49 loc) · 1.32 KB
/
MergeRequest.php
File metadata and controls
60 lines (49 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace kriskbx\gtt;
use Gitlab\Model\Note;
use Illuminate\Contracts\Support\Arrayable;
use kriskbx\gtt\Api\MergeRequests;
use kriskbx\gtt\Helper\ArrayAccessForGetterMethods;
use kriskbx\gtt\Time\HasTimes;
use kriskbx\gtt\Time\TimeAble;
class MergeRequest extends \Gitlab\Model\MergeRequest implements \ArrayAccess, Arrayable, TimeAble
{
use ArrayAccessForGetterMethods, HasTimes;
/**
* Don't include these 'properties' in ArrayAccess or toArray method
* @var array
*/
protected $methodExceptions = [
'data',
'client'
];
/**
* Parse this properties as Carbon objects
* @var array
*/
protected $dates = [];
/**
* Parse this properties as arrays and implode them as a string.
* @var array
*/
protected $arrays = [
'labels'
];
/**
* Fixing errors in GitLab PHP Api...
*
* @param int $page
* @param int $per_page
*
* @return Note[]
*/
public function showComments($page = 1, $per_page = 20)
{
$notes = array();
$data = (new MergeRequests($this->client))->showComments($this->project->id, $this->id, $page, $per_page);
foreach ($data as $note) {
$notes[] = Note::fromArray($this->getClient(), $this, $note);
}
return $notes;
}
}