class UpdateScriptTestHooks

Hook implementations for update_script_test.

Hierarchy

Expanded class hierarchy of UpdateScriptTestHooks

File

core/modules/system/tests/modules/update_script_test/src/Hook/UpdateScriptTestHooks.php, line 14

Namespace

Drupal\update_script_test\Hook
View source
class UpdateScriptTestHooks {
    use StringTranslationTrait;
    
    /**
     * Implements hook_cache_flush().
     *
     * This sets a message to confirm that all caches are cleared whenever
     * update.php completes.
     *
     * @see UpdateScriptFunctionalTest::testRequirements()
     */
    public function cacheFlush() : void {
        \Drupal::messenger()->addStatus($this->t('hook_cache_flush() invoked for update_script_test.module.'));
    }
    
    /**
     * Implements hook_system_info_alter().
     */
    public function systemInfoAlter(array &$info, Extension $file, $type) : void {
        $new_info = \Drupal::state()->get('update_script_test.system_info_alter');
        if ($new_info) {
            if ($file->getName() == 'update_script_test') {
                $info = $new_info + $info;
            }
        }
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
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
UpdateScriptTestHooks::cacheFlush public function Implements hook_cache_flush().
UpdateScriptTestHooks::systemInfoAlter public function Implements hook_system_info_alter().

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