1
0
mirror of https://github.com/flarum/core.git synced 2025-10-28 22:07:33 +01:00

fixed container bindings use of container (#2807)

This commit is contained in:
Daniël Klabbers
2021-04-29 21:33:51 +02:00
committed by GitHub
parent 40b47de9e1
commit fcb5778705
23 changed files with 246 additions and 245 deletions

View File

@@ -20,29 +20,25 @@ class UpdateServiceProvider extends AbstractServiceProvider
*/
public function register()
{
$this->container->singleton('flarum.update.routes', function () {
$this->container->singleton('flarum.update.routes', function (RouteHandlerFactory $route) {
$routes = new RouteCollection;
$this->populateRoutes($routes);
$this->populateRoutes($routes, $route);
return $routes;
});
}
/**
* {@inheritdoc}
*/
public function boot()
{
$this->loadViewsFrom(__DIR__.'/../../views/install', 'flarum.update');
}
/**
* @param RouteCollection $routes
* @param RouteCollection $routes
* @param RouteHandlerFactory $route
*/
protected function populateRoutes(RouteCollection $routes)
protected function populateRoutes(RouteCollection $routes, RouteHandlerFactory $route)
{
$route = $this->container->make(RouteHandlerFactory::class);
$routes->get(
'/{path:.*}',
'index',