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
18 changes: 9 additions & 9 deletions lib/Github/Api/Authorizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Authorizations extends AbstractApi
*/
public function all()
{
return $this->get('authorizations');
return $this->get('/authorizations');
}

/**
Expand All @@ -29,7 +29,7 @@ public function all()
*/
public function show($clientId)
{
return $this->get('authorizations/'.rawurlencode($clientId));
return $this->get('/authorizations/'.rawurlencode($clientId));
}

/**
Expand All @@ -44,7 +44,7 @@ public function create(array $params, $OTPCode = null)
{
$headers = null === $OTPCode ? array() : array('X-GitHub-OTP' => $OTPCode);

return $this->post('authorizations', $params, $headers);
return $this->post('/authorizations', $params, $headers);
}

/**
Expand All @@ -57,7 +57,7 @@ public function create(array $params, $OTPCode = null)
*/
public function update($clientId, array $params)
{
return $this->patch('authorizations/'.rawurlencode($clientId), $params);
return $this->patch('/authorizations/'.rawurlencode($clientId), $params);
}

/**
Expand All @@ -69,7 +69,7 @@ public function update($clientId, array $params)
*/
public function remove($clientId)
{
return $this->delete('authorizations/'.rawurlencode($clientId));
return $this->delete('/authorizations/'.rawurlencode($clientId));
}

/**
Expand All @@ -82,7 +82,7 @@ public function remove($clientId)
*/
public function check($clientId, $token)
{
return $this->get('applications/'.rawurlencode($clientId).'/tokens/'.rawurlencode($token));
return $this->get('/applications/'.rawurlencode($clientId).'/tokens/'.rawurlencode($token));
}

/**
Expand All @@ -95,7 +95,7 @@ public function check($clientId, $token)
*/
public function reset($clientId, $token)
{
return $this->post('applications/'.rawurlencode($clientId).'/tokens/'.rawurlencode($token));
return $this->post('/applications/'.rawurlencode($clientId).'/tokens/'.rawurlencode($token));
}

/**
Expand All @@ -106,7 +106,7 @@ public function reset($clientId, $token)
*/
public function revoke($clientId, $token)
{
$this->delete('applications/'.rawurlencode($clientId).'/tokens/'.rawurlencode($token));
$this->delete('/applications/'.rawurlencode($clientId).'/tokens/'.rawurlencode($token));
}

/**
Expand All @@ -116,6 +116,6 @@ public function revoke($clientId, $token)
*/
public function revokeAll($clientId)
{
$this->delete('applications/'.rawurlencode($clientId).'/tokens');
$this->delete('/applications/'.rawurlencode($clientId).'/tokens');
}
}
22 changes: 11 additions & 11 deletions lib/Github/Api/CurrentUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ class CurrentUser extends AbstractApi
{
public function show()
{
return $this->get('user');
return $this->get('/user');
}

public function update(array $params)
{
return $this->patch('user', $params);
return $this->patch('/user', $params);
}

/**
Expand All @@ -45,7 +45,7 @@ public function follow()

public function followers($page = 1)
{
return $this->get('user/followers', array(
return $this->get('/user/followers', array(
'page' => $page
));
}
Expand All @@ -60,7 +60,7 @@ public function followers($page = 1)
*/
public function issues(array $params = array(), $includeOrgIssues = true)
{
return $this->get($includeOrgIssues ? 'issues' : 'user/issues', array_merge(array('page' => 1), $params));
return $this->get($includeOrgIssues ? '/issues' : '/user/issues', array_merge(array('page' => 1), $params));
}

/**
Expand Down Expand Up @@ -94,7 +94,7 @@ public function memberships()
*/
public function organizations()
{
return $this->get('user/orgs');
return $this->get('/user/orgs');
}

/**
Expand All @@ -104,7 +104,7 @@ public function organizations()
*/
public function teams()
{
return $this->get('user/teams');
return $this->get('/user/teams');
}

/**
Expand All @@ -118,7 +118,7 @@ public function teams()
*/
public function repositories($type = 'owner', $sort = 'full_name', $direction = 'asc')
{
return $this->get('user/repos', array(
return $this->get('/user/repos', array(
'type' => $type,
'sort' => $sort,
'direction' => $direction
Expand All @@ -138,7 +138,7 @@ public function watchers()
*/
public function watched($page = 1)
{
return $this->get('user/watched', array(
return $this->get('/user/watched', array(
'page' => $page
));
}
Expand All @@ -156,16 +156,16 @@ public function starring()
*/
public function starred($page = 1)
{
return $this->get('user/starred', array(
return $this->get('/user/starred', array(
'page' => $page
));
}

/**
* @link https://developer.github.com/v3/activity/watching/#list-repositories-being-watched
*/
public function subscriptions()
{
return $this->get('user/subscriptions');
return $this->get('/user/subscriptions');
}
}
10 changes: 5 additions & 5 deletions lib/Github/Api/CurrentUser/DeployKeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DeployKeys extends AbstractApi
*/
public function all()
{
return $this->get('user/keys');
return $this->get('/user/keys');
}

/**
Expand All @@ -34,7 +34,7 @@ public function all()
*/
public function show($id)
{
return $this->get('user/keys/'.rawurlencode($id));
return $this->get('/user/keys/'.rawurlencode($id));
}

/**
Expand All @@ -54,7 +54,7 @@ public function create(array $params)
throw new MissingArgumentException(array('title', 'key'));
}

return $this->post('user/keys', $params);
return $this->post('/user/keys', $params);
}

/**
Expand All @@ -75,7 +75,7 @@ public function update($id, array $params)
throw new MissingArgumentException(array('title', 'key'));
}

return $this->patch('user/keys/'.rawurlencode($id), $params);
return $this->patch('/user/keys/'.rawurlencode($id), $params);
}

/**
Expand All @@ -89,6 +89,6 @@ public function update($id, array $params)
*/
public function remove($id)
{
return $this->delete('user/keys/'.rawurlencode($id));
return $this->delete('/user/keys/'.rawurlencode($id));
}
}
6 changes: 3 additions & 3 deletions lib/Github/Api/CurrentUser/Emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Emails extends AbstractApi
*/
public function all()
{
return $this->get('user/emails');
return $this->get('/user/emails');
}

/**
Expand All @@ -42,7 +42,7 @@ public function add($emails)
throw new InvalidArgumentException();
}

return $this->post('user/emails', $emails);
return $this->post('/user/emails', $emails);
}

/**
Expand All @@ -64,6 +64,6 @@ public function remove($emails)
throw new InvalidArgumentException();
}

return $this->delete('user/emails', $emails);
return $this->delete('/user/emails', $emails);
}
}
8 changes: 4 additions & 4 deletions lib/Github/Api/CurrentUser/Followers.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Followers extends AbstractApi
*/
public function all($page = 1)
{
return $this->get('user/following', array(
return $this->get('/user/following', array(
'page' => $page
));
}
Expand All @@ -37,7 +37,7 @@ public function all($page = 1)
*/
public function check($username)
{
return $this->get('user/following/'.rawurlencode($username));
return $this->get('/user/following/'.rawurlencode($username));
}

/**
Expand All @@ -51,7 +51,7 @@ public function check($username)
*/
public function follow($username)
{
return $this->put('user/following/'.rawurlencode($username));
return $this->put('/user/following/'.rawurlencode($username));
}

/**
Expand All @@ -65,6 +65,6 @@ public function follow($username)
*/
public function unfollow($username)
{
return $this->delete('user/following/'.rawurlencode($username));
return $this->delete('/user/following/'.rawurlencode($username));
}
}
6 changes: 3 additions & 3 deletions lib/Github/Api/CurrentUser/Memberships.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Memberships extends AbstractApi
*/
public function all()
{
return $this->get('user/memberships/orgs');
return $this->get('/user/memberships/orgs');
}

/**
Expand All @@ -29,7 +29,7 @@ public function all()
*/
public function organization($organization)
{
return $this->get('user/memberships/orgs/'.rawurlencode($organization));
return $this->get('/user/memberships/orgs/'.rawurlencode($organization));
}

/**
Expand All @@ -43,6 +43,6 @@ public function organization($organization)
*/
public function edit($organization)
{
return $this->patch('user/memberships/orgs/'.rawurlencode($organization), array('state' => 'active'));
return $this->patch('/user/memberships/orgs/'.rawurlencode($organization), array('state' => 'active'));
}
}
18 changes: 9 additions & 9 deletions lib/Github/Api/CurrentUser/Notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Notifications extends AbstractApi
*/
public function all(array $params = array())
{
return $this->get('notifications', $params);
return $this->get('/notifications', $params);
}

/**
Expand All @@ -37,7 +37,7 @@ public function all(array $params = array())
*/
public function allInRepository($username, $repository, array $params = array())
{
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/notifications', $params);
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/notifications', $params);
}

/**
Expand All @@ -51,7 +51,7 @@ public function allInRepository($username, $repository, array $params = array())
*/
public function markAsReadAll(array $params = array())
{
return $this->put('notifications', $params);
return $this->put('/notifications', $params);
}

/**
Expand All @@ -67,7 +67,7 @@ public function markAsReadAll(array $params = array())
*/
public function markAsReadInRepository($username, $repository, array $params = array())
{
return $this->put('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/notifications', $params);
return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/notifications', $params);
}

/**
Expand All @@ -82,7 +82,7 @@ public function markAsReadInRepository($username, $repository, array $params = a
*/
public function markAsRead($id, array $params)
{
return $this->patch('notifications/threads/'.rawurlencode($id), $params);
return $this->patch('/notifications/threads/'.rawurlencode($id), $params);
}

/**
Expand All @@ -96,7 +96,7 @@ public function markAsRead($id, array $params)
*/
public function show($id)
{
return $this->get('notifications/threads/'.rawurlencode($id));
return $this->get('/notifications/threads/'.rawurlencode($id));
}

/**
Expand All @@ -110,7 +110,7 @@ public function show($id)
*/
public function showSubscription($id)
{
return $this->get('notifications/threads/'.rawurlencode($id).'/subscription');
return $this->get('/notifications/threads/'.rawurlencode($id).'/subscription');
}

/**
Expand All @@ -125,7 +125,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/'.rawurlencode($id).'/subscription', $params);
}

/**
Expand All @@ -139,6 +139,6 @@ public function createSubscription($id, array $params)
*/
public function removeSubscription($id)
{
return $this->delete('notifications/threads/'.rawurlencode($id).'/subscription');
return $this->delete('/notifications/threads/'.rawurlencode($id).'/subscription');
}
}
Loading