move Router creation into App::runFrontend()

This commit is contained in:
Art4 2024-12-28 12:58:09 +00:00
parent 5af1dce914
commit 7cb962de82

View file

@ -170,7 +170,6 @@ class App
$this->mode->setExecutor(Mode::INDEX); $this->mode->setExecutor(Mode::INDEX);
$this->runFrontend( $this->runFrontend(
$this->container->create(Router::class),
$this->container->create(IManagePersonalConfigValues::class), $this->container->create(IManagePersonalConfigValues::class),
$this->container->create(Page::class), $this->container->create(Page::class),
$this->container->create(Nav::class), $this->container->create(Nav::class),
@ -529,7 +528,6 @@ class App
* *
* This probably should change to limit the size of this monster method. * This probably should change to limit the size of this monster method.
* *
* @param Router $router
* @param IManagePersonalConfigValues $pconfig * @param IManagePersonalConfigValues $pconfig
* @param Page $page The Friendica page printing container * @param Page $page The Friendica page printing container
* @param ModuleHTTPException $httpException The possible HTTP Exception container * @param ModuleHTTPException $httpException The possible HTTP Exception container
@ -539,7 +537,6 @@ class App
* @throws \ImagickException * @throws \ImagickException
*/ */
private function runFrontend( private function runFrontend(
Router $router,
IManagePersonalConfigValues $pconfig, IManagePersonalConfigValues $pconfig,
Page $page, Page $page,
Nav $nav, Nav $nav,
@ -675,6 +672,9 @@ class App
// Initialize module that can set the current theme in the init() method, either directly or via App->setProfileOwner // Initialize module that can set the current theme in the init() method, either directly or via App->setProfileOwner
$page['page_title'] = $moduleName; $page['page_title'] = $moduleName;
/** @var Router $router */
$router = $this->container->create(Router::class);
// The "view" module is required to show the theme CSS // The "view" module is required to show the theme CSS
if (!$this->mode->isInstall() && !$this->mode->has(Mode::MAINTENANCEDISABLED) && $moduleName !== 'view') { if (!$this->mode->isInstall() && !$this->mode->has(Mode::MAINTENANCEDISABLED) && $moduleName !== 'view') {
$module = $router->getModule(Maintenance::class); $module = $router->getModule(Maintenance::class);