function BreakpointManager::__construct

Same name in other branches
  1. 9 core/modules/breakpoint/src/BreakpointManager.php \Drupal\breakpoint\BreakpointManager::__construct()
  2. 8.9.x core/modules/breakpoint/src/BreakpointManager.php \Drupal\breakpoint\BreakpointManager::__construct()
  3. 10 core/modules/breakpoint/src/BreakpointManager.php \Drupal\breakpoint\BreakpointManager::__construct()

Constructs a new BreakpointManager instance.

Parameters

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

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

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: The cache backend.

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation service.

\Drupal\Core\Extension\ModuleExtensionList|null $module_extension_list: The module extension list.

Overrides DefaultPluginManager::__construct

File

core/modules/breakpoint/src/BreakpointManager.php, line 105

Class

BreakpointManager
Defines a breakpoint plugin manager to deal with breakpoints.

Namespace

Drupal\breakpoint

Code

public function __construct(ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, CacheBackendInterface $cache_backend, TranslationInterface $string_translation, ?ModuleExtensionList $module_extension_list = NULL) {
    $this->factory = new ContainerFactory($this);
    $this->moduleHandler = $module_handler;
    $this->themeHandler = $theme_handler;
    if ($module_extension_list === NULL) {
        @trigger_error('Calling ' . __METHOD__ . '() without the $module_extension_list argument is deprecated in drupal:10.3.0 and will be required in drupal:12.0.0. See https://www.drupal.org/node/3310017', E_USER_DEPRECATED);
        $module_extension_list = \Drupal::service('extension.list.module');
    }
    $this->moduleExtensionList = $module_extension_list;
    $this->setStringTranslation($string_translation);
    $this->alterInfo('breakpoints');
    $this->setCacheBackend($cache_backend, 'breakpoints', [
        'breakpoints',
    ]);
}

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