function GenerateTheme::getThemeInfo

Same name in other branches
  1. 10 core/lib/Drupal/Core/Command/GenerateTheme.php \Drupal\Core\Command\GenerateTheme::getThemeInfo()
  2. 11.x core/lib/Drupal/Core/Command/GenerateTheme.php \Drupal\Core\Command\GenerateTheme::getThemeInfo()

Gets theme info using the theme name.

Parameters

string $theme: The machine name of the theme.

Return value

\Drupal\Core\Extension\Extension|null

1 call to GenerateTheme::getThemeInfo()
GenerateTheme::execute in core/lib/Drupal/Core/Command/GenerateTheme.php

File

core/lib/Drupal/Core/Command/GenerateTheme.php, line 355

Class

GenerateTheme
Generates a new theme based on latest default markup.

Namespace

Drupal\Core\Command

Code

private function getThemeInfo(string $theme) : ?Extension {
    $extension_discovery = new ExtensionDiscovery($this->root, FALSE, []);
    $themes = $extension_discovery->scan('theme');
    if (!isset($themes[$theme])) {
        return NULL;
    }
    return $themes[$theme];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.