class DemoUmamiRequirements

Requirements for the Demo: Umami Food Magazine (Experimental) profile.

Hierarchy

Expanded class hierarchy of DemoUmamiRequirements

File

core/profiles/demo_umami/src/Hook/DemoUmamiRequirements.php, line 14

Namespace

Drupal\demo_umami\Hook
View source
class DemoUmamiRequirements {
    use StringTranslationTrait;
    public function __construct(ProfileExtensionList $profileExtensionList) {
    }
    
    /**
     * Implements hook_runtime_requirements().
     */
    public function runtime() : array {
        $requirements = [];
        $profile = \Drupal::installProfile();
        $info = $this->profileExtensionList
            ->getExtensionInfo($profile);
        $requirements['experimental_profile_used'] = [
            'title' => $this->t('Experimental installation profile used'),
            'value' => $info['name'],
            'description' => $this->t('Experimental profiles are provided for testing purposes only. Use at your own risk. To start building a new site, reinstall Drupal and choose a non-experimental profile.'),
            'severity' => REQUIREMENT_WARNING,
        ];
        return $requirements;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
DemoUmamiRequirements::runtime public function Implements hook_runtime_requirements().
DemoUmamiRequirements::__construct public function
StringTranslationTrait::$stringTranslation protected property The string translation service. 3
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language. 1

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