Skip to content

Commit 68175ad

Browse files
luceosaskvortsov1
authored andcommitted
Apply fixes from StyleCI
[ci skip] [skip ci]
1 parent daabb07 commit 68175ad

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/Foundation/ErrorHandling/FrontendFormatter.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
namespace Flarum\Foundation\ErrorHandling;
1111

1212
use Flarum\Frontend\Controller;
13-
use Flarum\Http\Content\PermissionDenied;
1413
use Flarum\Http\Content\NotAuthenticated;
1514
use Flarum\Http\Content\NotFound;
15+
use Flarum\Http\Content\PermissionDenied;
1616
use Flarum\Settings\SettingsRepositoryInterface;
1717
use Illuminate\Contracts\Container\Container;
1818
use Psr\Http\Message\ResponseInterface as Response;
@@ -56,15 +56,13 @@ public function __construct(Container $container, TranslatorInterface $translato
5656

5757
public function format(HandledError $error, Request $request): Response
5858
{
59-
$frontend = $this->container->make("flarum.frontend.forum");
59+
$frontend = $this->container->make('flarum.frontend.forum');
6060

6161
if ($error->getStatusCode() === 401) {
6262
$frontend->content(new NotAuthenticated);
63-
}
64-
elseif ($error->getStatusCode() === 403) {
63+
} elseif ($error->getStatusCode() === 403) {
6564
$frontend->content(new PermissionDenied);
66-
}
67-
elseif ($error->getStatusCode() === 404) {
65+
} elseif ($error->getStatusCode() === 404) {
6866
$frontend->content(new NotFound);
6967
}
7068

src/Http/HttpServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
namespace Flarum\Http;
1111

1212
use Flarum\Foundation\AbstractServiceProvider;
13+
use Flarum\Foundation\ErrorHandling\FrontendFormatter;
1314
use Flarum\Foundation\ErrorHandling\Registry;
1415
use Flarum\Foundation\ErrorHandling\Reporter;
15-
use Flarum\Foundation\ErrorHandling\FrontendFormatter;
1616
use Flarum\Foundation\ErrorHandling\WhoopsFormatter;
1717
use Flarum\Http\Exception\RouteNotFoundException;
1818
use Flarum\User\Exception\NotAuthenticatedException;

src/Http/Middleware/HandleErrors.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ public function process(Request $request, Handler $handler): Response
7676
}
7777
}
7878

79-
if (!$handled) {
79+
if (! $handled) {
8080
throw $e;
8181
}
82-
8382
}
8483
$error = $this->registry->handle($e);
8584

0 commit comments

Comments
 (0)