function DbUpdateNegotiator::__construct

Same name in other branches
  1. 8.9.x core/modules/system/src/Theme/DbUpdateNegotiator.php \Drupal\system\Theme\DbUpdateNegotiator::__construct()
  2. 10 core/modules/system/src/Theme/DbUpdateNegotiator.php \Drupal\system\Theme\DbUpdateNegotiator::__construct()
  3. 11.x core/modules/system/src/Theme/DbUpdateNegotiator.php \Drupal\system\Theme\DbUpdateNegotiator::__construct()

Constructs a DbUpdateNegotiator.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

\Drupal\Core\Extension\ThemeHandlerInterface|null $theme_handler: The theme handler.

File

core/modules/system/src/Theme/DbUpdateNegotiator.php, line 38

Class

DbUpdateNegotiator
Sets the active theme for the database update pages.

Namespace

Drupal\system\Theme

Code

public function __construct(ConfigFactoryInterface $config_factory, ThemeHandlerInterface $theme_handler = NULL) {
    $this->configFactory = $config_factory;
    if ($theme_handler === NULL) {
        @trigger_error('Calling ' . __METHOD__ . '() without the $theme_handler argument is deprecated in drupal:9.4.0 and $theme_handler argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3279699', E_USER_DEPRECATED);
        $theme_handler = \Drupal::service('theme_handler');
    }
    $this->themeHandler = $theme_handler;
}

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