mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-11-18 05:42:41 +09:00
changes
This commit is contained in:
47
vendor/knplabs/github-api/lib/Github/Api/RateLimit.php
vendored
Normal file
47
vendor/knplabs/github-api/lib/Github/Api/RateLimit.php
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
<?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'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user