1111use Github \Api \Repository \Forks ;
1212use Github \Api \Repository \Hooks ;
1313use Github \Api \Repository \Labels ;
14+ use Github \Api \Repository \Statuses ;
1415
1516/**
1617 * Searching repositories, getting repository information
@@ -144,6 +145,17 @@ public function contents()
144145 return new Contents ($ this ->client );
145146 }
146147
148+ /**
149+ * Manage the content of a repository
150+ * @link http://developer.github.com/v3/repos/downloads/
151+ *
152+ * @return Downloads
153+ */
154+ public function downloads ()
155+ {
156+ return new Downloads ($ this ->client );
157+ }
158+
147159 /**
148160 * Manage the deploy keys of a repository
149161 * @link http://developer.github.com/v3/repos/keys/
@@ -189,31 +201,14 @@ public function labels()
189201 }
190202
191203 /**
192- * @param string $username
193- * @param string $repository
194- * @param integer $page
204+ * Manage the statuses of a repository
205+ * @link http://developer.github.com/v3/repos/statuses/
195206 *
196- * @return array
207+ * @return Statuses
197208 */
198- public function watchers ( $ username , $ repository , $ page = 1 )
209+ public function statuses ( )
199210 {
200- return $ this ->get ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repository ).'/watchers ' , array (
201- 'page ' => $ page
202- ));
203- }
204-
205- /**
206- * Get the tags of a repository
207- * @link http://developer.github.com/v3/repos/
208- *
209- * @param string $username the user who owns the repository
210- * @param string $repository the name of the repository
211- *
212- * @return array list of the repository tags
213- */
214- public function tags ($ username , $ repository )
215- {
216- return $ this ->get ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repository ).'/tags ' );
211+ return new Statuses ($ this ->client );
217212 }
218213
219214 /**
@@ -236,6 +231,23 @@ public function branches($username, $repository, $branch = null)
236231 return $ this ->get ($ url );
237232 }
238233
234+ /**
235+ * Get the contributors of a repository
236+ * @link http://developer.github.com/v3/repos/
237+ *
238+ * @param string $username the user who owns the repository
239+ * @param string $repository the name of the repository
240+ * @param boolean $includingAnonymous by default, the list only shows GitHub users.
241+ * You can include non-users too by setting this to true
242+ * @return array list of the repo contributors
243+ */
244+ public function contributors ($ username , $ repository , $ includingAnonymous = false )
245+ {
246+ return $ this ->get ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repository ).'/contributors ' , array (
247+ 'anon ' => $ includingAnonymous ?: null
248+ ));
249+ }
250+
239251 /**
240252 * Get the language breakdown of a repository
241253 * @link http://developer.github.com/v3/repos/
@@ -251,20 +263,17 @@ public function languages($username, $repository)
251263 }
252264
253265 /**
254- * Get the contributors of a repository
266+ * Get the tags of a repository
255267 * @link http://developer.github.com/v3/repos/
256268 *
257- * @param string $username the user who owns the repository
258- * @param string $repository the name of the repository
259- * @param boolean $includingAnonymous by default, the list only shows GitHub users.
260- * You can include non-users too by setting this to true
261- * @return array list of the repo contributors
269+ * @param string $username the user who owns the repository
270+ * @param string $repository the name of the repository
271+ *
272+ * @return array list of the repository tags
262273 */
263- public function contributors ($ username , $ repository, $ includingAnonymous = false )
274+ public function tags ($ username , $ repository )
264275 {
265- return $ this ->get ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repository ).'/contributors ' , array (
266- 'anon ' => $ includingAnonymous ?: null
267- ));
276+ return $ this ->get ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repository ).'/tags ' );
268277 }
269278
270279 /**
@@ -282,16 +291,16 @@ public function teams($username, $repository)
282291 }
283292
284293 /**
285- * Get the downloads for selected repository
286- * @link http://developer.github.com/v3/repos/downloads/#list-downloads-for-a-repository
287- *
288- * @param string $username the user who owns the repository
289- * @param string $repository the name of the repository
294+ * @param string $username
295+ * @param string $repository
296+ * @param integer $page
290297 *
291298 * @return array
292299 */
293- public function downloads ($ username , $ repository )
300+ public function watchers ($ username , $ repository, $ page = 1 )
294301 {
295- return $ this ->get ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repository ).'/downloads ' );
302+ return $ this ->get ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repository ).'/watchers ' , array (
303+ 'page ' => $ page
304+ ));
296305 }
297306}
0 commit comments