mirror of
https://github.com/flarum/core.git
synced 2025-07-21 16:51:34 +02:00
Make existing extensions compatible with new stack
This commit is contained in:
@@ -12,11 +12,12 @@
|
||||
namespace Flarum\Http\Exception;
|
||||
|
||||
use Exception;
|
||||
use Flarum\Foundation\KnownError;
|
||||
|
||||
class ForbiddenException extends Exception
|
||||
class ForbiddenException extends Exception implements KnownError
|
||||
{
|
||||
public function __construct($message = null, $code = 403, Exception $previous = null)
|
||||
public function getType(): string
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
return 'forbidden';
|
||||
}
|
||||
}
|
||||
|
@@ -12,11 +12,12 @@
|
||||
namespace Flarum\Http\Exception;
|
||||
|
||||
use Exception;
|
||||
use Flarum\Foundation\KnownError;
|
||||
|
||||
class MethodNotAllowedException extends Exception
|
||||
class MethodNotAllowedException extends Exception implements KnownError
|
||||
{
|
||||
public function __construct($message = null, $code = 405, Exception $previous = null)
|
||||
public function getType(): string
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
return 'method_not_allowed';
|
||||
}
|
||||
}
|
||||
|
@@ -12,11 +12,12 @@
|
||||
namespace Flarum\Http\Exception;
|
||||
|
||||
use Exception;
|
||||
use Flarum\Foundation\KnownError;
|
||||
|
||||
class RouteNotFoundException extends Exception
|
||||
class RouteNotFoundException extends Exception implements KnownError
|
||||
{
|
||||
public function __construct($message = null, $code = 404, Exception $previous = null)
|
||||
public function getType(): string
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
return 'route_not_found';
|
||||
}
|
||||
}
|
||||
|
@@ -12,11 +12,12 @@
|
||||
namespace Flarum\Http\Exception;
|
||||
|
||||
use Exception;
|
||||
use Flarum\Foundation\KnownError;
|
||||
|
||||
class TokenMismatchException extends Exception
|
||||
class TokenMismatchException extends Exception implements KnownError
|
||||
{
|
||||
public function __construct($message = null, $code = 419, Exception $previous = null)
|
||||
public function getType(): string
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
return 'csrf_token_mismatch';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user