diff --git a/lib/Github/Api/Apps.php b/lib/Github/Api/Apps.php index 7a98e731ee8..bb2a2c463f9 100644 --- a/lib/Github/Api/Apps.php +++ b/lib/Github/Api/Apps.php @@ -36,7 +36,7 @@ public function createInstallationToken($installationId, $userId = null) $this->configurePreviewHeader(); - return $this->post('/app/installations/'.rawurlencode($installationId).'/access_tokens', $parameters); + return $this->post('/app/installations/'.$installationId.'/access_tokens', $parameters); } /** @@ -66,7 +66,7 @@ public function getInstallation($installationId) { $this->configurePreviewHeader(); - return $this->get('/app/installations/'.rawurldecode($installationId)); + return $this->get('/app/installations/'.$installationId); } /** @@ -129,7 +129,7 @@ public function removeInstallation($installationId) { $this->configurePreviewHeader(); - $this->delete('/app/installations/'.rawurldecode($installationId)); + $this->delete('/app/installations/'.$installationId); } /** @@ -167,7 +167,7 @@ public function addRepository($installationId, $repositoryId) { $this->configurePreviewHeader(); - return $this->put('/installations/'.rawurlencode($installationId).'/repositories/'.rawurlencode($repositoryId)); + return $this->put('/installations/'.$installationId.'/repositories/'.$repositoryId); } /** @@ -184,6 +184,6 @@ public function removeRepository($installationId, $repositoryId) { $this->configurePreviewHeader(); - return $this->delete('/installations/'.rawurlencode($installationId).'/repositories/'.rawurlencode($repositoryId)); + return $this->delete('/installations/'.$installationId.'/repositories/'.$repositoryId); } } diff --git a/lib/Github/Api/CurrentUser/Notifications.php b/lib/Github/Api/CurrentUser/Notifications.php index 36dfb57ef8f..9f3f2ce7bac 100644 --- a/lib/Github/Api/CurrentUser/Notifications.php +++ b/lib/Github/Api/CurrentUser/Notifications.php @@ -83,7 +83,7 @@ public function markAsReadInRepository($username, $repository, array $params = [ */ public function markAsRead($id, array $params) { - return $this->patch('/notifications/threads/'.rawurlencode($id), $params); + return $this->patch('/notifications/threads/'.$id, $params); } /** @@ -97,7 +97,7 @@ public function markAsRead($id, array $params) */ public function show($id) { - return $this->get('/notifications/threads/'.rawurlencode($id)); + return $this->get('/notifications/threads/'.$id); } /** @@ -111,7 +111,7 @@ public function show($id) */ public function showSubscription($id) { - return $this->get('/notifications/threads/'.rawurlencode($id).'/subscription'); + return $this->get('/notifications/threads/'.$id.'/subscription'); } /** @@ -126,7 +126,7 @@ public function showSubscription($id) */ public function createSubscription($id, array $params) { - return $this->put('/notifications/threads/'.rawurlencode($id).'/subscription', $params); + return $this->put('/notifications/threads/'.$id.'/subscription', $params); } /** @@ -140,6 +140,6 @@ public function createSubscription($id, array $params) */ public function removeSubscription($id) { - return $this->delete('/notifications/threads/'.rawurlencode($id).'/subscription'); + return $this->delete('/notifications/threads/'.$id.'/subscription'); } } diff --git a/lib/Github/Api/CurrentUser/PublicKeys.php b/lib/Github/Api/CurrentUser/PublicKeys.php index 706e14051ba..cb24dec9ace 100644 --- a/lib/Github/Api/CurrentUser/PublicKeys.php +++ b/lib/Github/Api/CurrentUser/PublicKeys.php @@ -35,7 +35,7 @@ public function all() */ public function show($id) { - return $this->get('/user/keys/'.rawurlencode($id)); + return $this->get('/user/keys/'.$id); } /** @@ -69,6 +69,6 @@ public function create(array $params) */ public function remove($id) { - return $this->delete('/user/keys/'.rawurlencode($id)); + return $this->delete('/user/keys/'.$id); } } diff --git a/lib/Github/Api/Deployment.php b/lib/Github/Api/Deployment.php index a6e9bacd755..6fa8700a6da 100644 --- a/lib/Github/Api/Deployment.php +++ b/lib/Github/Api/Deployment.php @@ -38,7 +38,7 @@ public function all($username, $repository, array $params = []) */ public function show($username, $repository, $id) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.rawurlencode($id)); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id); } /** @@ -88,7 +88,7 @@ public function updateStatus($username, $repository, $id, array $params) throw new MissingArgumentException(['state']); } - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.rawurlencode($id).'/statuses', $params); + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id.'/statuses', $params); } /** @@ -102,6 +102,6 @@ public function updateStatus($username, $repository, $id, array $params) */ public function getStatuses($username, $repository, $id) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.rawurlencode($id).'/statuses'); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id.'/statuses'); } } diff --git a/lib/Github/Api/Gist/Comments.php b/lib/Github/Api/Gist/Comments.php index 0e022622ed8..251ec7305ab 100644 --- a/lib/Github/Api/Gist/Comments.php +++ b/lib/Github/Api/Gist/Comments.php @@ -56,7 +56,7 @@ public function all($gist) */ public function show($gist, $comment) { - return $this->get('/gists/'.rawurlencode($gist).'/comments/'.rawurlencode($comment)); + return $this->get('/gists/'.rawurlencode($gist).'/comments/'.$comment); } /** @@ -83,7 +83,7 @@ public function create($gist, $body) */ public function update($gist, $comment_id, $body) { - return $this->patch('/gists/'.rawurlencode($gist).'/comments/'.rawurlencode($comment_id), ['body' => $body]); + return $this->patch('/gists/'.rawurlencode($gist).'/comments/'.$comment_id, ['body' => $body]); } /** @@ -96,6 +96,6 @@ public function update($gist, $comment_id, $body) */ public function remove($gist, $comment) { - return $this->delete('/gists/'.rawurlencode($gist).'/comments/'.rawurlencode($comment)); + return $this->delete('/gists/'.rawurlencode($gist).'/comments/'.$comment); } } diff --git a/lib/Github/Api/Gists.php b/lib/Github/Api/Gists.php index ee88c1292d1..69adef426fe 100644 --- a/lib/Github/Api/Gists.php +++ b/lib/Github/Api/Gists.php @@ -37,6 +37,11 @@ public function configure($bodyType = null) return $this; } + /** + * @param string|null $type + * + * @return array|string + */ public function all($type = null) { if (!in_array($type, ['public', 'starred'])) { @@ -46,6 +51,11 @@ public function all($type = null) return $this->get('/gists/'.rawurlencode($type)); } + /** + * @param string $number + * + * @return array + */ public function show($number) { return $this->get('/gists/'.rawurlencode($number)); @@ -54,7 +64,7 @@ public function show($number) /** * Get a specific revision of a gist. * - * @param int $number + * @param string $number * @param string $sha * * @link https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist @@ -77,41 +87,82 @@ public function create(array $params) return $this->post('/gists', $params); } + /** + * @param string $id + * @param array $params + * + * @return array + */ public function update($id, array $params) { return $this->patch('/gists/'.rawurlencode($id), $params); } + /** + * @param string $id + * + * @return array + */ public function commits($id) { return $this->get('/gists/'.rawurlencode($id).'/commits'); } + /** + * @param string $id + * + * @return array + */ public function fork($id) { return $this->post('/gists/'.rawurlencode($id).'/fork'); } + /** + * @param string $id + * + * @return array + */ public function forks($id) { return $this->get('/gists/'.rawurlencode($id).'/forks'); } + /** + * @param string $id + * + * @return array + */ public function remove($id) { return $this->delete('/gists/'.rawurlencode($id)); } + /** + * @param string $id + * + * @return array + */ public function check($id) { return $this->get('/gists/'.rawurlencode($id).'/star'); } + /** + * @param string $id + * + * @return array + */ public function star($id) { return $this->put('/gists/'.rawurlencode($id).'/star'); } + /** + * @param string $id + * + * @return array + */ public function unstar($id) { return $this->delete('/gists/'.rawurlencode($id).'/star'); diff --git a/lib/Github/Api/Issue.php b/lib/Github/Api/Issue.php index 9b7d1d043ed..73598267a6b 100644 --- a/lib/Github/Api/Issue.php +++ b/lib/Github/Api/Issue.php @@ -113,7 +113,7 @@ public function org($organization, $state, array $params = []) */ public function show($username, $repository, $id) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($id)); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id); } /** @@ -154,7 +154,7 @@ public function create($username, $repository, array $params) */ public function update($username, $repository, $id, array $params) { - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($id), $params); + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id, $params); } /** @@ -170,7 +170,7 @@ public function update($username, $repository, $id, array $params) */ public function lock($username, $repository, $id) { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($id).'/lock'); + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id.'/lock'); } /** @@ -186,7 +186,7 @@ public function lock($username, $repository, $id) */ public function unlock($username, $repository, $id) { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($id).'/lock'); + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id.'/lock'); } /** diff --git a/lib/Github/Api/Issue/Comments.php b/lib/Github/Api/Issue/Comments.php index 7dd2c96e9d2..997271c2f0b 100644 --- a/lib/Github/Api/Issue/Comments.php +++ b/lib/Github/Api/Issue/Comments.php @@ -59,7 +59,7 @@ public function all($username, $repository, $issue, $page = 1) ]; } - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/comments', $parameters); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/comments', $parameters); } /** @@ -75,7 +75,7 @@ public function all($username, $repository, $issue, $page = 1) */ public function show($username, $repository, $comment) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.rawurlencode($comment)); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.$comment); } /** @@ -98,7 +98,7 @@ public function create($username, $repository, $issue, array $params) throw new MissingArgumentException('body'); } - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/comments', $params); + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/comments', $params); } /** @@ -121,7 +121,7 @@ public function update($username, $repository, $comment, array $params) throw new MissingArgumentException('body'); } - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.rawurlencode($comment), $params); + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.$comment, $params); } /** @@ -137,6 +137,6 @@ public function update($username, $repository, $comment, array $params) */ public function remove($username, $repository, $comment) { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.rawurlencode($comment)); + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.$comment); } } diff --git a/lib/Github/Api/Issue/Events.php b/lib/Github/Api/Issue/Events.php index c846147e5f8..a628b2c60bf 100644 --- a/lib/Github/Api/Issue/Events.php +++ b/lib/Github/Api/Issue/Events.php @@ -26,7 +26,7 @@ class Events extends AbstractApi public function all($username, $repository, $issue = null, $page = 1) { if (null !== $issue) { - $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/events'; + $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/events'; } else { $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/events'; } diff --git a/lib/Github/Api/Issue/Labels.php b/lib/Github/Api/Issue/Labels.php index 248c4a7b583..d719578d943 100644 --- a/lib/Github/Api/Issue/Labels.php +++ b/lib/Github/Api/Issue/Labels.php @@ -29,7 +29,7 @@ public function all($username, $repository, $issue = null) if ($issue === null) { $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels'; } else { - $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/labels'; + $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels'; } return $this->get($path); @@ -137,7 +137,7 @@ public function add($username, $repository, $issue, $labels) throw new InvalidArgumentException('The labels parameter should be a single label or an array of labels'); } - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/labels', $labels); + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels', $labels); } /** @@ -154,7 +154,7 @@ public function add($username, $repository, $issue, $labels) */ public function replace($username, $repository, $issue, array $params) { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/labels', $params); + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels', $params); } /** @@ -171,7 +171,7 @@ public function replace($username, $repository, $issue, array $params) */ public function remove($username, $repository, $issue, $label) { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/labels/'.rawurlencode($label)); + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels/'.rawurlencode($label)); } /** @@ -187,6 +187,6 @@ public function remove($username, $repository, $issue, $label) */ public function clear($username, $repository, $issue) { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/labels'); + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels'); } } diff --git a/lib/Github/Api/Issue/Milestones.php b/lib/Github/Api/Issue/Milestones.php index 0e0e067c5e4..4cf2a3d5518 100644 --- a/lib/Github/Api/Issue/Milestones.php +++ b/lib/Github/Api/Issue/Milestones.php @@ -56,7 +56,7 @@ public function all($username, $repository, array $params = []) */ public function show($username, $repository, $id) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.rawurlencode($id)); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.$id); } /** @@ -102,7 +102,7 @@ public function update($username, $repository, $id, array $params) $params['state'] = 'open'; } - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.rawurlencode($id), $params); + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.$id, $params); } /** @@ -118,7 +118,7 @@ public function update($username, $repository, $id, array $params) */ public function remove($username, $repository, $id) { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.rawurlencode($id)); + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.$id); } /** @@ -134,6 +134,6 @@ public function remove($username, $repository, $id) */ public function labels($username, $repository, $id) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.rawurlencode($id).'/labels'); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.$id.'/labels'); } } diff --git a/lib/Github/Api/Issue/Timeline.php b/lib/Github/Api/Issue/Timeline.php index c0f76f2f761..16ec4b069b2 100644 --- a/lib/Github/Api/Issue/Timeline.php +++ b/lib/Github/Api/Issue/Timeline.php @@ -29,6 +29,6 @@ public function configure() */ public function all($username, $repository, $issue) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/timeline'); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/timeline'); } } diff --git a/lib/Github/Api/Organization/Hooks.php b/lib/Github/Api/Organization/Hooks.php index fc9318a3c45..945cabc8667 100644 --- a/lib/Github/Api/Organization/Hooks.php +++ b/lib/Github/Api/Organization/Hooks.php @@ -33,7 +33,7 @@ public function all($organization) */ public function show($organization, $id) { - return $this->get('/orgs/'.rawurlencode($organization).'/hooks/'.rawurlencode($id)); + return $this->get('/orgs/'.rawurlencode($organization).'/hooks/'.$id); } /** @@ -76,7 +76,7 @@ public function update($organization, $id, array $params) throw new MissingArgumentException(['config']); } - return $this->patch('/orgs/'.rawurlencode($organization).'/hooks/'.rawurlencode($id), $params); + return $this->patch('/orgs/'.rawurlencode($organization).'/hooks/'.$id, $params); } /** @@ -91,7 +91,7 @@ public function update($organization, $id, array $params) */ public function ping($organization, $id) { - return $this->post('/orgs/'.rawurlencode($organization).'/hooks/'.rawurlencode($id).'/pings'); + return $this->post('/orgs/'.rawurlencode($organization).'/hooks/'.$id.'/pings'); } /** @@ -106,6 +106,6 @@ public function ping($organization, $id) */ public function remove($organization, $id) { - return $this->delete('/orgs/'.rawurlencode($organization).'/hooks/'.rawurlencode($id)); + return $this->delete('/orgs/'.rawurlencode($organization).'/hooks/'.$id); } } diff --git a/lib/Github/Api/PullRequest.php b/lib/Github/Api/PullRequest.php index fbb763dc5bf..ffc713ba4a3 100644 --- a/lib/Github/Api/PullRequest.php +++ b/lib/Github/Api/PullRequest.php @@ -77,7 +77,7 @@ public function all($username, $repository, array $parameters = []) */ public function show($username, $repository, $id) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id)); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$id); } public function commits($username, $repository, $id) diff --git a/lib/Github/Api/PullRequest/Comments.php b/lib/Github/Api/PullRequest/Comments.php index 992fcd93bf5..3b71d490771 100644 --- a/lib/Github/Api/PullRequest/Comments.php +++ b/lib/Github/Api/PullRequest/Comments.php @@ -57,7 +57,7 @@ public function configure($bodyType = null, $apiVersion = null) public function all($username, $repository, $pullRequest = null, array $params = []) { if (null !== $pullRequest) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($pullRequest).'/comments'); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/comments'); } $parameters = array_merge([ @@ -81,7 +81,7 @@ public function all($username, $repository, $pullRequest = null, array $params = */ public function show($username, $repository, $comment) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments/'.rawurlencode($comment)); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments/'.$comment); } /** @@ -109,7 +109,7 @@ public function create($username, $repository, $pullRequest, array $params) throw new MissingArgumentException(['commit_id', 'path', 'position']); } - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($pullRequest).'/comments', $params); + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/comments', $params); } /** @@ -132,7 +132,7 @@ public function update($username, $repository, $comment, array $params) throw new MissingArgumentException('body'); } - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments/'.rawurlencode($comment), $params); + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments/'.$comment, $params); } /** @@ -148,6 +148,6 @@ public function update($username, $repository, $comment, array $params) */ public function remove($username, $repository, $comment) { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments/'.rawurlencode($comment)); + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments/'.$comment); } } diff --git a/lib/Github/Api/PullRequest/Review.php b/lib/Github/Api/PullRequest/Review.php index f984deab1e5..249477f0478 100644 --- a/lib/Github/Api/PullRequest/Review.php +++ b/lib/Github/Api/PullRequest/Review.php @@ -93,7 +93,7 @@ public function remove($username, $repository, $pullRequest, $id) */ public function comments($username, $repository, $pullRequest, $id) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($pullRequest).'/reviews/'.rawurlencode($id).'/comments'); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id.'/comments'); } /** diff --git a/lib/Github/Api/Repo.php b/lib/Github/Api/Repo.php index 63fd0358df7..867cb7efd08 100644 --- a/lib/Github/Api/Repo.php +++ b/lib/Github/Api/Repo.php @@ -64,7 +64,7 @@ public function all($id = null) return $this->get('/repositories'); } - return $this->get('/repositories?since='.rawurldecode($id)); + return $this->get('/repositories', ['since' => $id]); } /** @@ -171,7 +171,7 @@ public function show($username, $repository) */ public function showById($id) { - return $this->get('/repositories/'.rawurlencode($id)); + return $this->get('/repositories/'.$id); } /** diff --git a/lib/Github/Api/Repository/Assets.php b/lib/Github/Api/Repository/Assets.php index 56db6843de5..39cdc5da913 100644 --- a/lib/Github/Api/Repository/Assets.php +++ b/lib/Github/Api/Repository/Assets.php @@ -25,7 +25,7 @@ class Assets extends AbstractApi */ public function all($username, $repository, $id) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.rawurlencode($id).'/assets'); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id.'/assets'); } /** @@ -40,7 +40,7 @@ public function all($username, $repository, $id) */ public function show($username, $repository, $id) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/assets/'.rawurlencode($id)); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/assets/'.$id); } /** @@ -74,7 +74,7 @@ public function create($username, $repository, $id, $name, $contentType, $conten // Asset creation requires a separate endpoint, uploads.github.com. // Change the base url for the HTTP client temporarily while we execute // this request. - return $this->postRaw('https://uploads.github.com/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.rawurlencode($id).'/assets?name='.$name, $content, ['Content-Type' => $contentType]); + return $this->postRaw('https://uploads.github.com/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id.'/assets?name='.$name, $content, ['Content-Type' => $contentType]); } /** @@ -96,7 +96,7 @@ public function edit($username, $repository, $id, array $params) throw new MissingArgumentException('name'); } - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/assets/'.rawurlencode($id), $params); + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/assets/'.$id, $params); } /** @@ -111,6 +111,6 @@ public function edit($username, $repository, $id, array $params) */ public function remove($username, $repository, $id) { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/assets/'.rawurlencode($id)); + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/assets/'.$id); } } diff --git a/lib/Github/Api/Repository/Downloads.php b/lib/Github/Api/Repository/Downloads.php index ed4c42f27d4..c959c61545e 100644 --- a/lib/Github/Api/Repository/Downloads.php +++ b/lib/Github/Api/Repository/Downloads.php @@ -39,7 +39,7 @@ public function all($username, $repository) */ public function show($username, $repository, $id) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/downloads/'.rawurlencode($id)); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/downloads/'.$id); } /** @@ -55,6 +55,6 @@ public function show($username, $repository, $id) */ public function remove($username, $repository, $id) { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/downloads/'.rawurlencode($id)); + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/downloads/'.$id); } } diff --git a/lib/Github/Api/Repository/Releases.php b/lib/Github/Api/Repository/Releases.php index 4657bfa71f4..9d869b72d4a 100644 --- a/lib/Github/Api/Repository/Releases.php +++ b/lib/Github/Api/Repository/Releases.php @@ -65,7 +65,7 @@ public function all($username, $repository, array $params = []) */ public function show($username, $repository, $id) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.rawurlencode($id)); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id); } /** @@ -100,7 +100,7 @@ public function create($username, $repository, array $params) */ public function edit($username, $repository, $id, array $params) { - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.rawurlencode($id), $params); + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id, $params); } /** @@ -114,7 +114,7 @@ public function edit($username, $repository, $id, array $params) */ public function remove($username, $repository, $id) { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.rawurlencode($id)); + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id); } /** diff --git a/lib/Github/Api/User.php b/lib/Github/Api/User.php index c4414c56c75..e23418ad73d 100644 --- a/lib/Github/Api/User.php +++ b/lib/Github/Api/User.php @@ -42,7 +42,7 @@ public function all($id = null) return $this->get('/users'); } - return $this->get('/users', ['since' => rawurldecode($id)]); + return $this->get('/users', ['since' => $id]); } /** diff --git a/test/Github/Tests/Api/RepoTest.php b/test/Github/Tests/Api/RepoTest.php index 4bdfb419edd..88434750883 100644 --- a/test/Github/Tests/Api/RepoTest.php +++ b/test/Github/Tests/Api/RepoTest.php @@ -110,7 +110,7 @@ public function shouldGetAllRepositoriesStartingIndex() $api = $this->getApiMock(); $api->expects($this->once()) ->method('get') - ->with('/repositories?since=2') + ->with('/repositories', ['since' => 2]) ->will($this->returnValue($expectedArray)); $this->assertEquals($expectedArray, $api->all(2));