nginxsonarrradarrplexorganizrdashboardbookmarkapplication-dashboardmuximuxlandingpagestartpagelandinghtpcserverhomepagesabnzbdheimdallembycouchpotatonzbget
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
812 B
47 lines
812 B
<?php
|
|
|
|
namespace Github\Api;
|
|
|
|
/**
|
|
* Get rate limits.
|
|
*
|
|
* @link https://developer.github.com/v3/rate_limit/
|
|
*
|
|
* @author Jeff Finley <quickliketurtle@gmail.com>
|
|
*/
|
|
class RateLimit extends AbstractApi
|
|
{
|
|
/**
|
|
* Get rate limits.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function getRateLimits()
|
|
{
|
|
return $this->get('/rate_limit');
|
|
}
|
|
|
|
/**
|
|
* Get core rate limit.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getCoreLimit()
|
|
{
|
|
$response = $this->getRateLimits();
|
|
|
|
return $response['resources']['core']['limit'];
|
|
}
|
|
|
|
/**
|
|
* Get search rate limit.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getSearchLimit()
|
|
{
|
|
$response = $this->getRateLimits();
|
|
|
|
return $response['resources']['search']['limit'];
|
|
}
|
|
}
|
|
|