mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 06:39:40 +08: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:
parent
eb0e50a305
commit
72ba76b825
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user