mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-11-19 06:48:19 +09:00
changes
This commit is contained in:
32
vendor/knplabs/github-api/lib/Github/Exception/ApiLimitExceedException.php
vendored
Normal file
32
vendor/knplabs/github-api/lib/Github/Exception/ApiLimitExceedException.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Github\Exception;
|
||||
|
||||
/**
|
||||
* ApiLimitExceedException.
|
||||
*
|
||||
* @author Joseph Bielawski <stloyd@gmail.com>
|
||||
*/
|
||||
class ApiLimitExceedException extends RuntimeException
|
||||
{
|
||||
private $limit;
|
||||
private $reset;
|
||||
|
||||
public function __construct($limit = 5000, $reset = 1800, $code = 0, $previous = null)
|
||||
{
|
||||
$this->limit = (int) $limit;
|
||||
$this->reset = (int) $reset;
|
||||
|
||||
parent::__construct(sprintf('You have reached GitHub hourly limit! Actual limit is: %d', $limit), $code, $previous);
|
||||
}
|
||||
|
||||
public function getLimit()
|
||||
{
|
||||
return $this->limit;
|
||||
}
|
||||
|
||||
public function getResetTime()
|
||||
{
|
||||
return $this->reset;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user