mirror of
https://github.com/flarum/framework.git
synced 2025-01-21 01:45:33 +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
034000ea0b
commit
973fbcf17b
|
@ -62,7 +62,7 @@ class AdminServiceProvider extends AbstractServiceProvider
|
||||||
|
|
||||||
event(new ConfigureMiddleware($pipe, 'admin'));
|
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;
|
return $pipe;
|
||||||
});
|
});
|
||||||
|
|
|
@ -66,7 +66,7 @@ class ApiServiceProvider extends AbstractServiceProvider
|
||||||
|
|
||||||
event(new ConfigureMiddleware($pipe, 'api'));
|
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;
|
return $pipe;
|
||||||
});
|
});
|
||||||
|
|
|
@ -66,7 +66,7 @@ class ForumServiceProvider extends AbstractServiceProvider
|
||||||
|
|
||||||
event(new ConfigureMiddleware($pipe, 'forum'));
|
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;
|
return $pipe;
|
||||||
});
|
});
|
||||||
|
|
|
@ -99,10 +99,7 @@ class InstalledApp implements AppInterface
|
||||||
{
|
{
|
||||||
$pipe = new MiddlewarePipe;
|
$pipe = new MiddlewarePipe;
|
||||||
$pipe->pipe(
|
$pipe->pipe(
|
||||||
$this->laravel->make(
|
new DispatchRoute($this->laravel->make('flarum.update.routes'))
|
||||||
DispatchRoute::class,
|
|
||||||
['routes' => $this->laravel->make('flarum.update.routes')]
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return $pipe;
|
return $pipe;
|
||||||
|
|
|
@ -40,10 +40,7 @@ class Installer implements AppInterface
|
||||||
$pipe->pipe($this->laravel->make(HandleErrorsWithWhoops::class));
|
$pipe->pipe($this->laravel->make(HandleErrorsWithWhoops::class));
|
||||||
$pipe->pipe($this->laravel->make(StartSession::class));
|
$pipe->pipe($this->laravel->make(StartSession::class));
|
||||||
$pipe->pipe(
|
$pipe->pipe(
|
||||||
$this->laravel->make(
|
new DispatchRoute($this->laravel->make('flarum.install.routes'))
|
||||||
DispatchRoute::class,
|
|
||||||
['routes' => $this->laravel->make('flarum.install.routes')]
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return $pipe;
|
return $pipe;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user