You are here

public function UpdateController::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/update/src/Controller/UpdateController.php \Drupal\update\Controller\UpdateController::__construct()

Constructs update status data.

Parameters

\Drupal\update\UpdateManagerInterface $update_manager: Update Manager Service.

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

File

core/modules/update/src/Controller/UpdateController.php, line 39

Class

UpdateController
Controller routines for update routes.

Namespace

Drupal\update\Controller

Code

public function __construct(UpdateManagerInterface $update_manager, RendererInterface $renderer = NULL) {
  $this->updateManager = $update_manager;
  if (is_null($renderer)) {
    @trigger_error('The renderer service should be passed to UpdateController::__construct() since 9.1.0. This will be required in Drupal 10.0.0. See https://www.drupal.org/node/3179315', E_USER_DEPRECATED);
    $renderer = \Drupal::service('renderer');
  }
  $this->renderer = $renderer;
}