From e7c12ce928cc888a7ddf8676194eb4cf91e67808 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 22 Aug 2019 00:06:04 +0200 Subject: [PATCH] Remove superfluous ForbiddenException It has the same effect as the PermissionDeniedException, so let's just use that. Refs #1641. --- src/Extension/DefaultLanguagePackGuard.php | 4 ++-- src/Foundation/ErrorServiceProvider.php | 1 - src/Http/Exception/ForbiddenException.php | 21 --------------------- 3 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 src/Http/Exception/ForbiddenException.php diff --git a/src/Extension/DefaultLanguagePackGuard.php b/src/Extension/DefaultLanguagePackGuard.php index 1b66f0166..ee1dc6d12 100644 --- a/src/Extension/DefaultLanguagePackGuard.php +++ b/src/Extension/DefaultLanguagePackGuard.php @@ -10,8 +10,8 @@ namespace Flarum\Extension; use Flarum\Extension\Event\Disabling; -use Flarum\Http\Exception\ForbiddenException; use Flarum\Settings\SettingsRepositoryInterface; +use Flarum\User\Exception\PermissionDeniedException; use Illuminate\Support\Arr; class DefaultLanguagePackGuard @@ -36,7 +36,7 @@ class DefaultLanguagePackGuard $locale = Arr::get($event->extension->extra, 'flarum-locale.code'); if ($locale === $defaultLocale) { - throw new ForbiddenException('You cannot disable the default language pack!'); + throw new PermissionDeniedException('You cannot disable the default language pack!'); } } } diff --git a/src/Foundation/ErrorServiceProvider.php b/src/Foundation/ErrorServiceProvider.php index aa7060bb5..1d892976d 100644 --- a/src/Foundation/ErrorServiceProvider.php +++ b/src/Foundation/ErrorServiceProvider.php @@ -33,7 +33,6 @@ class ErrorServiceProvider extends AbstractServiceProvider 'invalid_access_token' => 401, // 403 Forbidden - 'forbidden' => 403, 'invalid_confirmation_token' => 403, 'permission_denied' => 403, diff --git a/src/Http/Exception/ForbiddenException.php b/src/Http/Exception/ForbiddenException.php deleted file mode 100644 index 88c6555f0..000000000 --- a/src/Http/Exception/ForbiddenException.php +++ /dev/null @@ -1,21 +0,0 @@ -