From 5c3bb6967562509d974f26838cd9a516113d8033 Mon Sep 17 00:00:00 2001 From: leonardaustin Date: Fri, 2 Aug 2013 16:29:09 +0100 Subject: [PATCH 1/2] Add stargazers methods --- lib/Github/Api/Repo.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/Github/Api/Repo.php b/lib/Github/Api/Repo.php index 0b7deab20ef..c6f2381c672 100644 --- a/lib/Github/Api/Repo.php +++ b/lib/Github/Api/Repo.php @@ -331,4 +331,19 @@ public function watchers($username, $repository, $page = 1) 'page' => $page )); } + + + /** + * @param string $username + * @param string $repository + * @param integer $page + * + * @return array + */ + public function stargazers($username, $repository, $page = 1) + { + return $this->get('repos/'.urlencode($username).'/'.urlencode($repository).'/stargazers', array( + 'page' => $page + )); + } } From 58b983584fce2425b73fecf49f5c5f2b7eed3883 Mon Sep 17 00:00:00 2001 From: leonardaustin Date: Mon, 12 Aug 2013 22:36:38 +0100 Subject: [PATCH 2/2] If calling rate_limit resource does not throw an exception if there is less than 0 requests remaining (rate_limit is exempt from any api request limits) --- lib/Github/HttpClient/Listener/ErrorListener.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Github/HttpClient/Listener/ErrorListener.php b/lib/Github/HttpClient/Listener/ErrorListener.php index 1d537240900..3f20c05093b 100644 --- a/lib/Github/HttpClient/Listener/ErrorListener.php +++ b/lib/Github/HttpClient/Listener/ErrorListener.php @@ -43,7 +43,8 @@ public function postSend(RequestInterface $request, MessageInterface $response) /** @var $response \Github\HttpClient\Message\Response */ if ($response->isClientError() || $response->isServerError()) { $remaining = $response->getHeader('X-RateLimit-Remaining'); - if (null !== $remaining && 1 > $remaining) { + + if (null !== $remaining && 1 > $remaining && 'rate_limit' !== substr($request->getResource(), 1, 10)) { throw new ApiLimitExceedException($this->options['api_limit']); }