Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ See [documentation](doc/customize.md) to know how to customize the client timeou
* The `setHttpClient` method have been removed. Use a `Gitlab\HttpClient\Builder` instead.
* The `getHttpClient` method return type is changed to `Http\Client\Common\HttpMethodsClient`.

## `Gitlab\Api\Issues` changes

* The second argument of `update`, `remove`, `showComments`, `showComment`, `addComment`, `updateComment`, `removeComment`,
`setTimeEstimate`, `resetTimeEstimate`, `addSpentTime` and `resetSpentTime` methods is now a scoped issue id (iid).

## `Gitlab\Api\Projects` changes

* The `keys`, `key`, `addKey`, `removeKey`, `disableKey` and `enableKey` methods have been removed.
Expand Down
66 changes: 33 additions & 33 deletions lib/Gitlab/Api/Issues.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,53 +44,53 @@ public function create($project_id, array $params)

/**
* @param int $project_id
* @param int $issue_id
* @param int $issue_iid
* @param array $params
* @return mixed
*/
public function update($project_id, $issue_id, array $params)
public function update($project_id, $issue_iid, array $params)
{
return $this->put($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)), $params);
return $this->put($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid)), $params);
}

/**
* @param int $project_id
* @param int $issue_id
* @param int $issue_iid
* @return mixed
*/
public function remove($project_id, $issue_id)
public function remove($project_id, $issue_iid)
{
return $this->delete($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)));
return $this->delete($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid)));
}

/**
* @param int $project_id
* @param int $issue_id
* @param int $issue_iid
* @return mixed
*/
public function showComments($project_id, $issue_id)
public function showComments($project_id, $issue_iid)
{
return $this->get($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)).'/notes');
return $this->get($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid)).'/notes');
}

/**
* @param int $project_id
* @param int $issue_id
* @param int $issue_iid
* @param int $note_id
* @return mixed
*/
public function showComment($project_id, $issue_id, $note_id)
public function showComment($project_id, $issue_iid, $note_id)
{
return $this->get($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)).'/notes/'.$this->encodePath($note_id));
return $this->get($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid)).'/notes/'.$this->encodePath($note_id));
}

/**
* @param int $project_id
* @param int $issue_id
* @param int $issue_iid
* @param string|array $body
* @return mixed
*/
public function addComment($project_id, $issue_id, $body)
public function addComment($project_id, $issue_iid, $body)
{
// backwards compatibility
if (is_array($body)) {
Expand All @@ -99,70 +99,70 @@ public function addComment($project_id, $issue_id, $body)
$params = array('body' => $body);
}

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

/**
* @param int $project_id
* @param int $issue_id
* @param int $issue_iid
* @param int $note_id
* @param string $body
* @return mixed
*/
public function updateComment($project_id, $issue_id, $note_id, $body)
public function updateComment($project_id, $issue_iid, $note_id, $body)
{
return $this->put($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/notes/'.$this->encodePath($note_id)), array(
return $this->put($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/notes/'.$this->encodePath($note_id)), array(
'body' => $body
));
}

/**
* @param int $project_id
* @param int $issue_id
* @param int $issue_iid
* @param int $note_id
* @return mixed
*/
public function removeComment($project_id, $issue_id, $note_id)
public function removeComment($project_id, $issue_iid, $note_id)
{
return $this->delete($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/notes/'.$this->encodePath($note_id)));
return $this->delete($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/notes/'.$this->encodePath($note_id)));
}

/**
* @param int $project_id
* @param int $issue_id
* @param int $issue_iid
* @param string $duration
*/
public function setTimeEstimate($project_id, $issue_id, $duration)
public function setTimeEstimate($project_id, $issue_iid, $duration)
{
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/time_estimate'), array('duration' => $duration));
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/time_estimate'), array('duration' => $duration));
}

/**
* @param int $project_id
* @param int $issue_id
* @param int $issue_iid
*/
public function resetTimeEstimate($project_id, $issue_id)
public function resetTimeEstimate($project_id, $issue_iid)
{
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/reset_time_estimate'));
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/reset_time_estimate'));
}

/**
* @param int $project_id
* @param int $issue_id
* @param int $issue_iid
* @param string $duration
*/
public function addSpentTime($project_id, $issue_id, $duration)
public function addSpentTime($project_id, $issue_iid, $duration)
{
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/add_spent_time'), array('duration' => $duration));
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/add_spent_time'), array('duration' => $duration));
}

/**
* @param int $project_id
* @param int $issue_id
* @param int $issue_iid
*/
public function resetSpentTime($project_id, $issue_id)
public function resetSpentTime($project_id, $issue_iid)
{
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/reset_spent_time'));
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_iid).'/reset_spent_time'));
}

/**
Expand Down