-
-
Notifications
You must be signed in to change notification settings - Fork 599
Added 'user/repos' missing endpoint #472
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,6 +145,8 @@ public function subscriptions($username) | |
} | ||
|
||
/** | ||
* @deprecated use repos($username, $options) instead | ||
* | ||
* Get the repositories of a user. | ||
* | ||
* @link http://developer.github.com/v3/repos/ | ||
|
@@ -158,13 +160,26 @@ public function subscriptions($username) | |
*/ | ||
public function repositories($username, $type = 'owner', $sort = 'full_name', $direction = 'asc') | ||
{ | ||
return $this->get('/users/'.rawurlencode($username).'/repos', array( | ||
return $this->repos($username, array( | ||
'type' => $type, | ||
'sort' => $sort, | ||
'direction' => $direction | ||
)); | ||
} | ||
|
||
/** | ||
* @param null $username | ||
* @param array $options | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should explain the valid array keys. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or better add in-code assert |
||
* | ||
* @return array list of the user repositories | ||
*/ | ||
public function repos($username = null, array $options = array()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you should use short array syntax |
||
{ | ||
$url = $username ? '/users/'.rawurldecode($username).'/repos' : '/user/repos'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm. This seams like two functions mixed in one method. I'm not 100% convinced. It may be better to "repos()" and "myRepos()" (but with better naming) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no other API endpoint that we are using an optional username. I recommend using two functions. |
||
|
||
return $this->get($url, $options); | ||
} | ||
|
||
/** | ||
* Get the public gists for a user. | ||
* | ||
|
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.
You should remove this function. It is okey, we will soon release a new major version.
Please make sure to add this in the changelog.