Skip to content
Merged
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
10 changes: 10 additions & 0 deletions lib/Gitlab/Api/Issues.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ public function update($project_id, $issue_id, array $params)
return $this->put($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)), $params);
}

/**
* @param int $project_id
* @param int $issue_id
* @return mixed
*/
public function remove($project_id, $issue_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brammeleman let's pls use delete on the method name, to keep the API's naming: https://docs.gitlab.com/ce/api/issues.html#delete-an-issue.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmh... I'm confused: the gitlab API just tells to do a http delete on an issue id, which is like any other object in gitlab.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All other objects use remove:

~/src/php-gitlab-api/lib/Gitlab/Api $ grep function * | egrep 'remove|delete'
AbstractApi.php:    protected function delete($path, array $parameters = array(), $requestHeaders = array())
Groups.php:    public function remove($group_id)
Groups.php:    public function removeMember($group_id, $user_id)
Issues.php:    public function remove($project_id, $issue_id)
Projects.php:    public function remove($project_id)
Projects.php:    public function removeMember($project_id, $user_id)
Projects.php:    public function removeHook($project_id, $hook_id)
Projects.php:    public function removeKey($project_id, $key_id)
Projects.php:    public function removeLabel($project_id, $name)
Projects.php:    public function removeForkRelation($project_id)
Projects.php:    public function removeService($project_id, $service_name)
Projects.php:    public function removeVariable($project_id, $key)
Repositories.php:    public function deleteBranch($project_id, $branch_name)
Repositories.php:    public function deleteFile($project_id, $file_path, $branch_name, $commit_message)
Snippets.php:    public function remove($project_id, $snippet_id)
SystemHooks.php:    public function remove($id)
Users.php:    public function remove($id)
Users.php:    public function removeKey($id)
Users.php:    public function removeUserKey($user_id, $key_id)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well.. there are 2 there :) .. we should rename the Repositories ones..

{
return $this->delete($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)), $params);
}

/**
* @param int $project_id
* @param int $issue_id
Expand Down