diff -u b/core/lib/Drupal/Core/Theme/ThemeInitialization.php b/core/lib/Drupal/Core/Theme/ThemeInitialization.php --- b/core/lib/Drupal/Core/Theme/ThemeInitialization.php +++ b/core/lib/Drupal/Core/Theme/ThemeInitialization.php @@ -54,12 +54,13 @@ * The theme handler. * @param \Drupal\Core\State\StateInterface $state * The state. + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler to use to load modules. */ public function __construct($root, ThemeHandlerInterface $theme_handler, StateInterface $state, ModuleHandlerInterface $module_handler) { $this->root = $root; $this->themeHandler = $theme_handler; $this->state = $state; - $this->moduleHandler = $module_handler; } @@ -111,7 +112,6 @@ $base_themes[] = $themes[$ancestor]; } - $this->prepareExtensions(); $active_theme = $this->getActiveTheme($themes[$theme_name], $base_themes); $this->state->set('theme.active_theme.' . $theme_name, $active_theme); @@ -223,7 +223,7 @@ * * @return array */ - protected function prepareExtensions() { + protected function getExtensions() { if (!isset($this->extensions)) { $this->extensions = array_merge($this->moduleHandler->getModuleList(), $this->themeHandler->listInfo()); } @@ -231,12 +231,13 @@ } /** - * Resolves tokens from the stylesheets remove. + * Gets CSS file where tokens have been resolved. * - * @param array $list + * @param string $css_file + * CSS file which may contain tokens. * - * @return array - * List of stylesheets where placeholders are replaced. + * @return string + * CSS file where placeholders are replaced. */ protected function resolveStyleSheetPlaceholders($css_file) { $token_candidate = explode('/', $css_file)[0]; @@ -247,7 +248,7 @@ $token = substr($token_candidate, 1); if (isset($this->extensions[$token])) { - return str_replace($token_candidate, $this->extensions[$token]->getPath(), $css_file); + return str_replace($token_candidate, $this->getExtensions()[$token]->getPath(), $css_file); } } }