class Requirements1TestHooks
Hook implementations for requirements1_test.
Hierarchy
- class \Drupal\requirements1_test\Hook\Requirements1TestHooks uses \Drupal\Core\StringTranslation\StringTranslationTrait
Expanded class hierarchy of Requirements1TestHooks
File
-
core/
modules/ system/ tests/ modules/ requirements1_test/ src/ Hook/ Requirements1TestHooks.php, line 13
Namespace
Drupal\requirements1_test\HookView source
class Requirements1TestHooks {
use StringTranslationTrait;
/**
* Implements hook_requirements_alter().
*/
public function requirementsAlter(array &$requirements) : void {
// Change the title.
$requirements['requirements1_test_alterable']['title'] = $this->t('Requirements 1 Test - Changed');
// Decrease the severity.
$requirements['requirements1_test_alterable']['severity'] = REQUIREMENT_WARNING;
// Delete 'requirements1_test_deletable',
unset($requirements['requirements1_test_deletable']);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overrides |
---|---|---|---|---|
Requirements1TestHooks::requirementsAlter | public | function | Implements hook_requirements_alter(). | |
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.