sonarrradarrplexorganizrnginxdashboardlandingpagestartpagelandinghtpcserverhomepagesabnzbdheimdallembycouchpotatonzbgetbookmarkapplication-dashboardmuximux
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.
48 lines
812 B
48 lines
812 B
6 years ago
|
<?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'];
|
||
|
}
|
||
|
}
|