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;
|
|
|
|
|
2017-12-30 23:35:26 +03:00
|
|
|
class AuthenticationException extends RuntimeException
|
2016-07-04 15:45:18 +03:00
|
|
|
{
|
|
|
|
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
|
|
|
}
|