function TestSubscriber::getStateKey

Computes the state key to use for a given event class.

Parameters

string $event: The event class.

Return value

string The state key under which to store the results for the given event.

5 calls to TestSubscriber::getStateKey()
TestSubscriber::handleEvent in core/modules/package_manager/tests/modules/package_manager_test_validation/src/EventSubscriber/TestSubscriber.php
Adds validation results to a stage event.
TestSubscriber::setException in core/modules/package_manager/tests/modules/package_manager_test_validation/src/EventSubscriber/TestSubscriber.php
Sets an exception to throw for a specific event.
TestSubscriber::setExit in core/modules/package_manager/tests/modules/package_manager_test_validation/src/EventSubscriber/TestSubscriber.php
Sets whether a specific event will call exit().
TestSubscriber::setMessage in core/modules/package_manager/tests/modules/package_manager_test_validation/src/EventSubscriber/TestSubscriber.php
Sets a status message that will be sent to the messenger for an event.
TestSubscriber::setTestResult in core/modules/package_manager/tests/modules/package_manager_test_validation/src/EventSubscriber/TestSubscriber.php
Sets validation results for a specific event.

File

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

Class

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

Namespace

Drupal\package_manager_test_validation\EventSubscriber

Code

protected static function getStateKey(string $event) : string {
    $key = hash('sha256', static::class . $event);
    return static::STATE_KEY . substr($key, 0, 8);
}

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