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)
145
145
}
146
146
147
147
/**
148
+ * @deprecated use repos($username, $options) instead
149
+ *
148
150
* Get the repositories of a user.
149
151
*
150
152
* @link http://developer.github.com/v3/repos/
@@ -158,13 +160,26 @@ public function subscriptions($username)
158
160
*/
159
161
public function repositories ($ username , $ type = 'owner ' , $ sort = 'full_name ' , $ direction = 'asc ' )
160
162
{
161
- return $ this ->get ( ' /users/ ' . rawurlencode ( $ username). ' /repos ' , array (
163
+ return $ this ->repos ( $ username , array (
162
164
'type ' => $ type ,
163
165
'sort ' => $ sort ,
164
166
'direction ' => $ direction
165
167
));
166
168
}
167
169
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
+
168
183
/**
169
184
* Get the public gists for a user.
170
185
*
You can’t perform that action at this time.
0 commit comments