@@ -145,11 +145,9 @@ public function subscriptions($username)
145145 }
146146
147147 /**
148- * @deprecated use repos($username, $options) instead
148+ * List public repositories for the specified user.
149149 *
150- * Get the repositories of a user.
151- *
152- * @link http://developer.github.com/v3/repos/
150+ * @link https://developer.github.com/v3/repos/#list-user-repositories
153151 *
154152 * @param string $username the username
155153 * @param string $type role in the repository
@@ -160,24 +158,25 @@ public function subscriptions($username)
160158 */
161159 public function repositories ($ username , $ type = 'owner ' , $ sort = 'full_name ' , $ direction = 'asc ' )
162160 {
163- return $ this ->repos ( $ username, array (
161+ return $ this ->get ( ' /users/ ' . rawurlencode ( $ username). ' /repos ' , [
164162 'type ' => $ type ,
165163 'sort ' => $ sort ,
166- 'direction ' => $ direction
167- ) );
164+ 'direction ' => $ direction,
165+ ] );
168166 }
169167
170168 /**
171- * @param null $username
172- * @param array $options
169+ * List repositories that are accessible to the authenticated user.
170+ *
171+ * @link https://developer.github.com/v3/repos/#list-your-repositories
172+ *
173+ * @param array $params visibility, affiliation, type, sort, direction
173174 *
174175 * @return array list of the user repositories
175176 */
176- public function repos ( $ username = null , array $ options = array () )
177+ public function myRepositories ( array $ params = [] )
177178 {
178- $ url = $ username ? '/users/ ' .rawurldecode ($ username ).'/repos ' : '/user/repos ' ;
179-
180- return $ this ->get ($ url , $ options );
179+ return $ this ->get ('/user/repos ' , $ params );
181180 }
182181
183182 /**
0 commit comments