Skip to content

Commit 942e5a3

Browse files
committed
Add missing method to MR API
1 parent 2f6d802 commit 942e5a3

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

lib/Gitlab/Api/MergeRequests.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ public function merge($project_id, $mr_id, array $params)
4343
return $this->put('projects/'.urlencode($project_id).'/merge_request/'.urlencode($mr_id).'/merge', $params);
4444
}
4545

46+
public function showComments($project_id, $issue_id)
47+
{
48+
return $this->get('projects/'.urlencode($project_id).'/issues/'.urlencode($issue_id).'/notes');
49+
}
50+
4651
public function addComment($project_id, $mr_id, $note)
4752
{
4853
return $this->post('projects/'.urlencode($project_id).'/merge_request/'.urlencode($mr_id).'/comments', array(

lib/Gitlab/Model/MergeRequest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@ public function addComment($note)
101101
return Note::fromArray($this->getClient(), $this, $data);
102102
}
103103

104-
public function showComments()
105-
{
106-
$notes = array();
107-
$data = $this->api('mr')->showComments($this->project->id, $this->id);
104+
public function showComments()
105+
{
106+
$notes = array();
107+
$data = $this->api('mr')->showComments($this->project->id, $this->id);
108108

109-
foreach ($data as $note) {
110-
$notes[] = Note::fromArray($this->getClient(), $this, $note);
111-
}
109+
foreach ($data as $note) {
110+
$notes[] = Note::fromArray($this->getClient(), $this, $note);
111+
}
112112

113-
return $notes;
114-
}
113+
return $notes;
114+
}
115115

116116
public function isClosed()
117117
{

0 commit comments

Comments
 (0)