1
0
mirror of https://github.com/flarum/core.git synced 2025-05-01 21:17:51 +02:00

Instantiate DispatchRoute manually

Since we are already providing the first and only argument
manually, we might as well instantiate the object manually.
Same effect, same coupling, less code.
This commit is contained in:
Franz Liedke 2018-08-21 23:42:00 +02:00
parent 034000ea0b
commit 973fbcf17b
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4
5 changed files with 5 additions and 11 deletions

@ -62,7 +62,7 @@ class AdminServiceProvider extends AbstractServiceProvider
event(new ConfigureMiddleware($pipe, 'admin'));
$pipe->pipe($app->make(DispatchRoute::class, ['routes' => $app->make('flarum.admin.routes')]));
$pipe->pipe(new DispatchRoute($app->make('flarum.admin.routes')));
return $pipe;
});

@ -66,7 +66,7 @@ class ApiServiceProvider extends AbstractServiceProvider
event(new ConfigureMiddleware($pipe, 'api'));
$pipe->pipe($app->make(DispatchRoute::class, ['routes' => $app->make('flarum.api.routes')]));
$pipe->pipe(new DispatchRoute($app->make('flarum.api.routes')));
return $pipe;
});

@ -66,7 +66,7 @@ class ForumServiceProvider extends AbstractServiceProvider
event(new ConfigureMiddleware($pipe, 'forum'));
$pipe->pipe($app->make(DispatchRoute::class, ['routes' => $app->make('flarum.forum.routes')]));
$pipe->pipe(new DispatchRoute($app->make('flarum.forum.routes')));
return $pipe;
});

@ -99,10 +99,7 @@ class InstalledApp implements AppInterface
{
$pipe = new MiddlewarePipe;
$pipe->pipe(
$this->laravel->make(
DispatchRoute::class,
['routes' => $this->laravel->make('flarum.update.routes')]
)
new DispatchRoute($this->laravel->make('flarum.update.routes'))
);
return $pipe;

@ -40,10 +40,7 @@ class Installer implements AppInterface
$pipe->pipe($this->laravel->make(HandleErrorsWithWhoops::class));
$pipe->pipe($this->laravel->make(StartSession::class));
$pipe->pipe(
$this->laravel->make(
DispatchRoute::class,
['routes' => $this->laravel->make('flarum.install.routes')]
)
new DispatchRoute($this->laravel->make('flarum.install.routes'))
);
return $pipe;