function TestClass::getSubscribedEvents

Same name in other branches
  1. 9 core/modules/system/tests/modules/service_provider_test/src/TestClass.php \Drupal\service_provider_test\TestClass::getSubscribedEvents()
  2. 8.9.x core/modules/system/tests/modules/service_provider_test/src/TestClass.php \Drupal\service_provider_test\TestClass::getSubscribedEvents()
  3. 11.x core/modules/system/tests/modules/service_provider_test/src/TestClass.php \Drupal\service_provider_test\TestClass::getSubscribedEvents()

Registers methods as kernel listeners.

Return value

array An array of event listener definitions.

File

core/modules/system/tests/modules/service_provider_test/src/TestClass.php, line 57

Class

TestClass

Namespace

Drupal\service_provider_test

Code

public static function getSubscribedEvents() : array {
    $events[KernelEvents::REQUEST][] = [
        'onKernelRequestTest',
    ];
    $events[KernelEvents::RESPONSE][] = [
        'onKernelResponseTest',
    ];
    return $events;
}

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