Skip to content

Commit 6b6f13a

Browse files
Adds support for optional Note parameters
Co-Authored-By: Claas Augner <[email protected]>
1 parent 2e98d42 commit 6b6f13a

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

src/Api/Issues.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,29 +154,31 @@ public function showNote($project_id, int $issue_iid, int $note_id)
154154
* @param int|string $project_id
155155
* @param int $issue_iid
156156
* @param string $body
157+
* @param array $params
157158
*
158159
* @return mixed
159160
*/
160-
public function addNote($project_id, int $issue_iid, string $body)
161+
public function addNote($project_id, int $issue_iid, string $body, array $params = [])
161162
{
162-
return $this->post($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/notes'), [
163-
'body' => $body,
164-
]);
163+
$params['body'] = $body;
164+
165+
return $this->post($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/notes'), $params);
165166
}
166167

167168
/**
168169
* @param int|string $project_id
169170
* @param int $issue_iid
170171
* @param int $note_id
171172
* @param string $body
173+
* @param array $params
172174
*
173175
* @return mixed
174176
*/
175-
public function updateNote($project_id, int $issue_iid, int $note_id, string $body)
177+
public function updateNote($project_id, int $issue_iid, int $note_id, string $body, array $params = [])
176178
{
177-
return $this->put($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/notes/'.self::encodePath($note_id)), [
178-
'body' => $body,
179-
]);
179+
$params['body'] = $body;
180+
181+
return $this->put($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/notes/'.self::encodePath($note_id)), $params);
180182
}
181183

182184
/**

src/Api/MergeRequests.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,15 @@ public function showNote($project_id, int $mr_iid, int $note_id)
224224
* @param int|string $project_id
225225
* @param int $mr_iid
226226
* @param string $body
227+
* @param array $params
227228
*
228229
* @return mixed
229230
*/
230-
public function addNote($project_id, int $mr_iid, string $body)
231+
public function addNote($project_id, int $mr_iid, string $body, array $params = [])
231232
{
232-
return $this->post($this->getProjectPath($project_id, 'merge_requests/'.self::encodePath($mr_iid).'/notes'), [
233-
'body' => $body,
234-
]);
233+
$params['body'] = $body;
234+
235+
return $this->post($this->getProjectPath($project_id, 'merge_requests/'.self::encodePath($mr_iid).'/notes'), $params);
235236
}
236237

237238
/**

src/Api/Snippets.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,15 @@ public function showNote($project_id, int $snippet_id, int $note_id)
107107
* @param int|string $project_id
108108
* @param int $snippet_id
109109
* @param string $body
110+
* @param array $params
110111
*
111112
* @return mixed
112113
*/
113-
public function addNote($project_id, int $snippet_id, string $body)
114+
public function addNote($project_id, int $snippet_id, string $body, array $params = [])
114115
{
115-
return $this->post($this->getProjectPath($project_id, 'snippets/'.self::encodePath($snippet_id).'/notes'), [
116-
'body' => $body,
117-
]);
116+
$params['body'] = $body;
117+
118+
return $this->post($this->getProjectPath($project_id, 'snippets/'.self::encodePath($snippet_id).'/notes'), $params);
118119
}
119120

120121
/**

0 commit comments

Comments
 (0)