for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Equip\Auth\Exception;
use Exception;
/**
* Exception that occurs when a user specifies an authentication token that is
* invalid.
*/
class InvalidException extends AuthException
{
const CODE = 403;
* @param string $message
* @param int $code
* @param Exception $previous
public function __construct(
$message = 'The token being used is invalid',
$code = 0,
Exception $previous = null
) {
if ($code === 0) {
$code = static::CODE;
}
parent::__construct($message, $code, $previous);
* @param string $token
public static function tokenExpired($token, Exception $previous = null)
throw new static(
sprintf('Token expired: %s', $token),
static::CODE,
$previous
);
public static function tokenUnparseable($token, Exception $previous = null)
sprintf('Could not parse token: %s', $token),
public static function invalidSignature($token, Exception $previous = null)
sprintf('Token signature is not valid: %s', $token),
public static function invalidToken($token, Exception $previous = null)
sprintf('Token is expired or otherwise invalid: %s', $token),