X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FExtension%2FThemeInstaller.php;h=2d6567fa188665cf411c92c73979aa9777a78d77;hb=refs%2Fheads%2Fd864;hp=db1226fa982ae6ae69908c7f8c9c3a396d5f917b;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Extension/ThemeInstaller.php b/web/core/lib/Drupal/Core/Extension/ThemeInstaller.php index db1226fa9..2d6567fa1 100644 --- a/web/core/lib/Drupal/Core/Extension/ThemeInstaller.php +++ b/web/core/lib/Drupal/Core/Extension/ThemeInstaller.php @@ -7,6 +7,7 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\ConfigInstallerInterface; use Drupal\Core\Config\ConfigManagerInterface; +use Drupal\Core\Extension\Exception\UnknownExtensionException; use Drupal\Core\Routing\RouteBuilderInterface; use Drupal\Core\State\StateInterface; use Psr\Log\LoggerInterface; @@ -111,7 +112,7 @@ class ThemeInstaller implements ThemeInstallerInterface { if ($missing = array_diff_key($theme_list, $theme_data)) { // One or more of the given themes doesn't exist. - throw new \InvalidArgumentException('Unknown themes: ' . implode(', ', $missing) . '.'); + throw new UnknownExtensionException('Unknown themes: ' . implode(', ', $missing) . '.'); } // Only process themes that are not installed currently. @@ -121,9 +122,9 @@ class ThemeInstaller implements ThemeInstallerInterface { return TRUE; } - while (list($theme) = each($theme_list)) { + foreach ($theme_list as $theme => $value) { // Add dependencies to the list. The new themes will be processed as - // the while loop continues. + // the parent foreach loop continues. foreach (array_keys($theme_data[$theme]->requires) as $dependency) { if (!isset($theme_data[$dependency])) { // The dependency does not exist. @@ -221,7 +222,7 @@ class ThemeInstaller implements ThemeInstallerInterface { $list = $this->themeHandler->listInfo(); foreach ($theme_list as $key) { if (!isset($list[$key])) { - throw new \InvalidArgumentException("Unknown theme: $key."); + throw new UnknownExtensionException("Unknown theme: $key."); } if ($key === $theme_config->get('default')) { throw new \InvalidArgumentException("The current default theme $key cannot be uninstalled."); @@ -265,7 +266,6 @@ class ThemeInstaller implements ThemeInstallerInterface { $extension_config->save(TRUE); $this->state->set('system.theme.data', $current_theme_data); - // @todo Remove system_list(). $this->themeHandler->refreshInfo(); $this->resetSystem();