You are here

function system_post_update_uninstall_classy in Drupal 9

Uninstall Classy if it is no longer needed.

File

core/modules/system/system.post_update.php, line 118
Post update functions for System.

Code

function system_post_update_uninstall_classy() {

  /** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */
  $theme_installer = \Drupal::getContainer()
    ->get('theme_installer');
  try {
    $theme_installer
      ->uninstall([
      'classy',
    ]);
  } catch (\InvalidArgumentException|UnknownExtensionException $exception) {

    // Exception is thrown if Classy wasn't installed or if there are themes
    // depending on it.
  }
}