Skip to content

Commit cd1014b

Browse files
authored
Merge pull request #217 from fbourigault/v4-api-9530
Use issue iid in all issues related endpoints
2 parents f4a4742 + d0b3a07 commit cd1014b

File tree

2 files changed

+38
-33
lines changed

2 files changed

+38
-33
lines changed

UPGRADE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ See [documentation](doc/customize.md) to know how to customize the client timeou
1313
* The `setHttpClient` method have been removed. Use a `Gitlab\HttpClient\Builder` instead.
1414
* The `getHttpClient` method return type is changed to `Http\Client\Common\HttpMethodsClient`.
1515

16+
## `Gitlab\Api\Issues` changes
17+
18+
* The second argument of `update`, `remove`, `showComments`, `showComment`, `addComment`, `updateComment`, `removeComment`,
19+
`setTimeEstimate`, `resetTimeEstimate`, `addSpentTime` and `resetSpentTime` methods is now a scoped issue id (iid).
20+
1621
## `Gitlab\Api\Projects` changes
1722

1823
* The `keys`, `key`, `addKey`, `removeKey`, `disableKey` and `enableKey` methods have been removed.

lib/Gitlab/Api/Issues.php

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -44,53 +44,53 @@ public function create($project_id, array $params)
4444

4545
/**
4646
* @param int $project_id
47-
* @param int $issue_id
47+
* @param int $issue_iid
4848
* @param array $params
4949
* @return mixed
5050
*/
51-
public function update($project_id, $issue_id, array $params)
51+
public function update($project_id, $issue_iid, array $params)
5252
{
53-
return $this->put($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)), $params);
53+
return $this->put($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid)), $params);
5454
}
5555

5656
/**
5757
* @param int $project_id
58-
* @param int $issue_id
58+
* @param int $issue_iid
5959
* @return mixed
6060
*/
61-
public function remove($project_id, $issue_id)
61+
public function remove($project_id, $issue_iid)
6262
{
63-
return $this->delete($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)));
63+
return $this->delete($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid)));
6464
}
6565

6666
/**
6767
* @param int $project_id
68-
* @param int $issue_id
68+
* @param int $issue_iid
6969
* @return mixed
7070
*/
71-
public function showComments($project_id, $issue_id)
71+
public function showComments($project_id, $issue_iid)
7272
{
73-
return $this->get($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)).'/notes');
73+
return $this->get($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid)).'/notes');
7474
}
7575

7676
/**
7777
* @param int $project_id
78-
* @param int $issue_id
78+
* @param int $issue_iid
7979
* @param int $note_id
8080
* @return mixed
8181
*/
82-
public function showComment($project_id, $issue_id, $note_id)
82+
public function showComment($project_id, $issue_iid, $note_id)
8383
{
84-
return $this->get($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)).'/notes/'.$this->encodePath($note_id));
84+
return $this->get($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid)).'/notes/'.$this->encodePath($note_id));
8585
}
8686

8787
/**
8888
* @param int $project_id
89-
* @param int $issue_id
89+
* @param int $issue_iid
9090
* @param string|array $body
9191
* @return mixed
9292
*/
93-
public function addComment($project_id, $issue_id, $body)
93+
public function addComment($project_id, $issue_iid, $body)
9494
{
9595
// backwards compatibility
9696
if (is_array($body)) {
@@ -99,70 +99,70 @@ public function addComment($project_id, $issue_id, $body)
9999
$params = array('body' => $body);
100100
}
101101

102-
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/notes'), $params);
102+
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/notes'), $params);
103103
}
104104

105105
/**
106106
* @param int $project_id
107-
* @param int $issue_id
107+
* @param int $issue_iid
108108
* @param int $note_id
109109
* @param string $body
110110
* @return mixed
111111
*/
112-
public function updateComment($project_id, $issue_id, $note_id, $body)
112+
public function updateComment($project_id, $issue_iid, $note_id, $body)
113113
{
114-
return $this->put($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/notes/'.$this->encodePath($note_id)), array(
114+
return $this->put($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/notes/'.$this->encodePath($note_id)), array(
115115
'body' => $body
116116
));
117117
}
118118

119119
/**
120120
* @param int $project_id
121-
* @param int $issue_id
121+
* @param int $issue_iid
122122
* @param int $note_id
123123
* @return mixed
124124
*/
125-
public function removeComment($project_id, $issue_id, $note_id)
125+
public function removeComment($project_id, $issue_iid, $note_id)
126126
{
127-
return $this->delete($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/notes/'.$this->encodePath($note_id)));
127+
return $this->delete($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/notes/'.$this->encodePath($note_id)));
128128
}
129129

130130
/**
131131
* @param int $project_id
132-
* @param int $issue_id
132+
* @param int $issue_iid
133133
* @param string $duration
134134
*/
135-
public function setTimeEstimate($project_id, $issue_id, $duration)
135+
public function setTimeEstimate($project_id, $issue_iid, $duration)
136136
{
137-
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/time_estimate'), array('duration' => $duration));
137+
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/time_estimate'), array('duration' => $duration));
138138
}
139139

140140
/**
141141
* @param int $project_id
142-
* @param int $issue_id
142+
* @param int $issue_iid
143143
*/
144-
public function resetTimeEstimate($project_id, $issue_id)
144+
public function resetTimeEstimate($project_id, $issue_iid)
145145
{
146-
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/reset_time_estimate'));
146+
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/reset_time_estimate'));
147147
}
148148

149149
/**
150150
* @param int $project_id
151-
* @param int $issue_id
151+
* @param int $issue_iid
152152
* @param string $duration
153153
*/
154-
public function addSpentTime($project_id, $issue_id, $duration)
154+
public function addSpentTime($project_id, $issue_iid, $duration)
155155
{
156-
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/add_spent_time'), array('duration' => $duration));
156+
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/add_spent_time'), array('duration' => $duration));
157157
}
158158

159159
/**
160160
* @param int $project_id
161-
* @param int $issue_id
161+
* @param int $issue_iid
162162
*/
163-
public function resetSpentTime($project_id, $issue_id)
163+
public function resetSpentTime($project_id, $issue_iid)
164164
{
165-
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/reset_spent_time'));
165+
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/reset_spent_time'));
166166
}
167167

168168
/**

0 commit comments

Comments
 (0)