function RouterTestEarlyExceptionSubscriber::getSubscribedEvents

Same name in other branches
  1. 11.x core/modules/system/tests/modules/router_test_directory/src/RouterTestEarlyExceptionSubscriber.php \Drupal\router_test\RouterTestEarlyExceptionSubscriber::getSubscribedEvents()

File

core/modules/system/tests/modules/router_test_directory/src/RouterTestEarlyExceptionSubscriber.php, line 35

Class

RouterTestEarlyExceptionSubscriber
Event subscribers for exceptions thrown in early kernel middleware.

Namespace

Drupal\router_test

Code

public static function getSubscribedEvents() : array {
    // This is the same priority as AuthenticationSubscriber, however
    // exceptions are not restricted to authentication; this is a common,
    // early point to emulate an exception, e.g. when an OAuth token is
    // rejected.
    $events[KernelEvents::REQUEST][] = [
        'onKernelRequest',
        300,
    ];
    return $events;
}

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