-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added "deleteIssue" function and changed "CurlClient" to support DELETE request #53
base: master
Are you sure you want to change the base?
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
@@ -72,6 +72,9 @@ public function __construct( | |||
AuthenticationInterface $authentication, | |||
ClientInterface $client = null | |||
) { | |||
//Regular expression to remove trailing slash | |||
$endpoint = preg_replace('{/$}', '', $endpoint); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DELETE calls can have parameters. The correct implementation is done in #76.