mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-10 08:53:57 +09:00
Update to laravel 7
This commit is contained in:
@@ -2,17 +2,25 @@
|
||||
|
||||
namespace Github\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* ApiLimitExceedException.
|
||||
*
|
||||
* @author Joseph Bielawski <stloyd@gmail.com>
|
||||
*/
|
||||
class ApiLimitExceedException extends RuntimeException
|
||||
{
|
||||
/** @var int */
|
||||
private $limit;
|
||||
/** @var int */
|
||||
private $reset;
|
||||
|
||||
public function __construct($limit = 5000, $reset = 1800, $code = 0, $previous = null)
|
||||
/**
|
||||
* @param int $limit
|
||||
* @param int $reset
|
||||
* @param int $code
|
||||
* @param Throwable|null $previous
|
||||
*/
|
||||
public function __construct(int $limit = 5000, int $reset = 1800, int $code = 0, Throwable $previous = null)
|
||||
{
|
||||
$this->limit = (int) $limit;
|
||||
$this->reset = (int) $reset;
|
||||
@@ -20,12 +28,18 @@ class ApiLimitExceedException extends RuntimeException
|
||||
parent::__construct(sprintf('You have reached GitHub hourly limit! Actual limit is: %d', $limit), $code, $previous);
|
||||
}
|
||||
|
||||
public function getLimit()
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getLimit(): int
|
||||
{
|
||||
return $this->limit;
|
||||
}
|
||||
|
||||
public function getResetTime()
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getResetTime(): int
|
||||
{
|
||||
return $this->reset;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
namespace Github\Exception;
|
||||
|
||||
/**
|
||||
* BadMethodCallException.
|
||||
*
|
||||
* @author James Brooks <jbrooksuk@me.com>
|
||||
*/
|
||||
class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
namespace Github\Exception;
|
||||
|
||||
/**
|
||||
* ErrorException.
|
||||
*
|
||||
* @author Joseph Bielawski <stloyd@gmail.com>
|
||||
*/
|
||||
class ErrorException extends \ErrorException implements ExceptionInterface
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
namespace Github\Exception;
|
||||
|
||||
/**
|
||||
* InvalidArgumentException.
|
||||
*
|
||||
* @author Joseph Bielawski <stloyd@gmail.com>
|
||||
*/
|
||||
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
|
||||
|
||||
@@ -2,19 +2,24 @@
|
||||
|
||||
namespace Github\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* MissingArgumentException.
|
||||
*
|
||||
* @author Joseph Bielawski <stloyd@gmail.com>
|
||||
*/
|
||||
class MissingArgumentException extends ErrorException
|
||||
{
|
||||
public function __construct($required, $code = 0, $previous = null)
|
||||
/**
|
||||
* @param string|array $required
|
||||
* @param int $code
|
||||
* @param Throwable|null $previous
|
||||
*/
|
||||
public function __construct($required, int $code = 0, Throwable $previous = null)
|
||||
{
|
||||
if (is_string($required)) {
|
||||
$required = [$required];
|
||||
}
|
||||
|
||||
parent::__construct(sprintf('One or more of required ("%s") parameters is missing!', implode('", "', $required)), $code, $previous);
|
||||
parent::__construct(sprintf('One or more of required ("%s") parameters is missing!', implode('", "', $required)), $code, 1, __FILE__, __LINE__, $previous);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
namespace Github\Exception;
|
||||
|
||||
/**
|
||||
* RuntimeException.
|
||||
*
|
||||
* @author Joseph Bielawski <stloyd@gmail.com>
|
||||
*/
|
||||
class RuntimeException extends \RuntimeException implements ExceptionInterface
|
||||
|
||||
31
vendor/knplabs/github-api/lib/Github/Exception/SsoRequiredException.php
vendored
Normal file
31
vendor/knplabs/github-api/lib/Github/Exception/SsoRequiredException.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Github\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
class SsoRequiredException extends RuntimeException
|
||||
{
|
||||
/** @var string */
|
||||
private $url;
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param int $code
|
||||
* @param Throwable|null $previous
|
||||
*/
|
||||
public function __construct(string $url, int $code = 0, Throwable $previous = null)
|
||||
{
|
||||
$this->url = $url;
|
||||
|
||||
parent::__construct('Resource protected by organization SAML enforcement. You must grant your personal token access to this organization.', $code, $previous);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
}
|
||||
@@ -2,17 +2,28 @@
|
||||
|
||||
namespace Github\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
class TwoFactorAuthenticationRequiredException extends RuntimeException
|
||||
{
|
||||
/** @var string */
|
||||
private $type;
|
||||
|
||||
public function __construct($type, $code = 0, $previous = null)
|
||||
/**
|
||||
* @param string $type
|
||||
* @param int $code
|
||||
* @param Throwable|null $previous
|
||||
*/
|
||||
public function __construct(string $type, int $code = 0, Throwable $previous = null)
|
||||
{
|
||||
$this->type = $type;
|
||||
parent::__construct('Two factor authentication is enabled on this account', $code, $previous);
|
||||
}
|
||||
|
||||
public function getType()
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user