Added "deleteIssue" function and changed "CurlClient" to support DELETE request#53
Added "deleteIssue" function and changed "CurlClient" to support DELETE request#53marek-knappe wants to merge 4 commits into
Conversation
marek-knappe
commented
Oct 30, 2015
- added "deleteIssue" function
- changed "CurlClient" to support DELETE request
Added regular expression to remove trailing slash if included in URL. Api::__construct
Add Worklogs to API
Fixed trailing slash in URL
| ClientInterface $client = null | ||
| ) { | ||
| //Regular expression to remove trailing slash | ||
| $endpoint = preg_replace('{/$}', '', $endpoint); |
There was a problem hiding this comment.
By replace code with solution below no explanatory comment is needed:
$endpoint = rtrim($endpoint, '/');Sounds like useful change, but not sure how it's related to this PR.
There was a problem hiding this comment.
Actually just remove it from this PR, because there is another PR doing the same thing: #25 .
| * @param $params | ||
| * @return mixed | ||
| */ | ||
| public function getWorklogs($issueKey, $params) |
There was a problem hiding this comment.
Please remove, because this is already submitted as part of #37.
|
@marek-knappe I see now why you have all your PR code mixed together. You're not using feature branches and submitting PR's from Unfortunately GitHub doesn't allow to change PR branch and therefore the only viable approach is this:
|
| return $this->api( | ||
| self::REQUEST_DELETE, sprintf("/rest/api/2/issue/%s", $issueKey), | ||
| array ( | ||
| 'deleteSubtasks' => $deleteSubtasks |
There was a problem hiding this comment.
Please change $deleteSubtasks into $deleteSubtasks ? 'true' : 'false'.
In such case I usually submit different PRs and mention somewhere that another PR needs to be merged first for this one to work. |
|
If you find it better (less going back and forward) I'm happy for you or anyone to make it properly :) |
| curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data)); | ||
| } | ||
| } elseif ($method == "DELETE") { | ||
| curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE"); |
There was a problem hiding this comment.
The DELETE calls can have parameters. The correct implementation is done in #76.