function SystemTestController::secondShutdown

Same name and namespace in other branches
  1. main core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::secondShutdown()

Dummy shutdown function.

File

core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php, line 645

Class

SystemTestController
Controller routines for system_test routes.

Namespace

Drupal\system_test\Controller

Code

public static function secondShutdown($arg1, $arg2) : void {
  // Set something to ensure that this function got called.
  \Drupal::state()->set('_system_test_second_shutdown_function', [
    $arg1,
    $arg2,
  ]);
  // Throw an exception with an HTML tag. Since this is called in a shutdown
  // function, it will not bubble up to the default exception handler but will
  // be caught in _drupal_shutdown_function() and be displayed through
  // \Drupal\Core\Utility\Error::renderExceptionSafe() if possible.
  throw new \Exception('Drupal is <blink>awesome</blink>.');
}

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