Skip to content

Commit 5b7de52

Browse files
committed
Repo::all method
1 parent d04c463 commit 5b7de52

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lib/Github/Api/Repo.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,23 @@ public function find($keyword, array $params = array())
3939
return $this->get('legacy/repos/search/'.rawurlencode($keyword), array_merge(array('start_page' => 1), $params));
4040
}
4141

42+
/**
43+
* List all public repositories.
44+
*
45+
* @link https://developer.github.com/v3/repos/#list-all-public-repositories
46+
*
47+
* @param int|null $id The integer ID of the last Repository that you’ve seen.
48+
*
49+
* @return array list of users found
50+
*/
51+
public function all($id = null)
52+
{
53+
if (!is_int($id)) {
54+
return $this->get('repositories');
55+
}
56+
return $this->get('repositories?since=' . rawurldecode($id));
57+
}
58+
4259
/**
4360
* Get the last year of commit activity for a repository grouped by week.
4461
*

0 commit comments

Comments
 (0)