2016-07-04 15:45:18 +03:00
|
|
|
<?php
|
2017-10-12 11:13:20 +03:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2016-07-19 18:27:55 +03:00
|
|
|
namespace Shlinkio\Shlink\Rest\Exception;
|
|
|
|
|
2016-07-20 11:13:53 +03:00
|
|
|
use Shlinkio\Shlink\Common\Exception\ExceptionInterface;
|
2016-07-04 15:45:18 +03:00
|
|
|
|
|
|
|
class AuthenticationException extends \RuntimeException implements ExceptionInterface
|
|
|
|
{
|
|
|
|
public static function fromCredentials($username, $password)
|
|
|
|
{
|
|
|
|
return new self(sprintf('Invalid credentials. Username -> "%s". Password -> "%s"', $username, $password));
|
|
|
|
}
|
2016-08-07 15:44:33 +03:00
|
|
|
|
|
|
|
public static function expiredJWT(\Exception $prev = null)
|
|
|
|
{
|
|
|
|
return new self('The token has expired.', -1, $prev);
|
|
|
|
}
|
2016-07-04 15:45:18 +03:00
|
|
|
}
|