File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,8 @@ public function subscriptions($username)
145145 }
146146
147147 /**
148+ * @deprecated use repos($username, $options) instead
149+ *
148150 * Get the repositories of a user.
149151 *
150152 * @link http://developer.github.com/v3/repos/
@@ -158,13 +160,26 @@ public function subscriptions($username)
158160 */
159161 public function repositories ($ username , $ type = 'owner ' , $ sort = 'full_name ' , $ direction = 'asc ' )
160162 {
161- return $ this ->get ( ' /users/ ' . rawurlencode ( $ username). ' /repos ' , array (
163+ return $ this ->repos ( $ username , array (
162164 'type ' => $ type ,
163165 'sort ' => $ sort ,
164166 'direction ' => $ direction
165167 ));
166168 }
167169
170+ /**
171+ * @param null $username
172+ * @param array $options
173+ *
174+ * @return array list of the user repositories
175+ */
176+ public function repos ($ username = null , array $ options = array ())
177+ {
178+ $ url = $ username ? 'users/ ' .rawurldecode ($ username ).'/repos ' : 'user/repos ' ;
179+
180+ return $ this ->get ($ url , $ options );
181+ }
182+
168183 /**
169184 * Get the public gists for a user.
170185 *
You can’t perform that action at this time.
0 commit comments