function TestSubscriber::setMessage

Sets a status message that will be sent to the messenger for an event.

Parameters

string $message: Message text.

string $event: The event class.

File

core/modules/package_manager/tests/modules/package_manager_test_validation/src/EventSubscriber/TestSubscriber.php, line 171

Class

TestSubscriber
Defines an event subscriber for testing validation of Package Manager events.

Namespace

Drupal\package_manager_test_validation\EventSubscriber

Code

public static function setMessage(string $message, string $event) : void {
    $key = static::getStateKey($event);
    $state = \Drupal::state();
    $state->set($key, $message);
}

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