function SystemTestController::__construct

Same name in other branches
  1. 9 core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::__construct()
  2. 8.9.x core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::__construct()
  3. 11.x core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::__construct()

Constructs the SystemTestController.

Parameters

\Drupal\Core\Lock\LockBackendInterface $lock: The lock service.

\Drupal\Core\Lock\LockBackendInterface $persistent_lock: The persistent lock service.

\Drupal\Core\Session\AccountInterface $current_user: The current user.

\Drupal\Core\Render\RendererInterface $renderer: The renderer.

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger service.

\Drupal\Core\PageCache\ResponsePolicy\KillSwitch|null $killSwitch: The page cache kill switch. This is here to test nullable types with \Drupal\Core\DependencyInjection\AutowireTrait::create().

\Drupal\Core\PageCache\ResponsePolicy\KillSwitch|null $killSwitch2: The page cache kill switch. This is here to test nullable types with \Drupal\Core\DependencyInjection\AutowireTrait::create().

File

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

Class

SystemTestController
Controller routines for system_test routes.

Namespace

Drupal\system_test\Controller

Code

public function __construct(LockBackendInterface $lock, LockBackendInterface $persistent_lock, AccountInterface $current_user, RendererInterface $renderer, MessengerInterface $messenger, ?KillSwitch $killSwitch = NULL, KillSwitch|null $killSwitch2 = NULL) {
    $this->lock = $lock;
    $this->persistentLock = $persistent_lock;
    $this->currentUser = $current_user;
    $this->renderer = $renderer;
    $this->messenger = $messenger;
}

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