You are here

protected function FilteredPluginManagerTrait::moduleHandler in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Plugin/FilteredPluginManagerTrait.php \Drupal\Core\Plugin\FilteredPluginManagerTrait::moduleHandler()

Wraps the module handler.

Return value

\Drupal\Core\Extension\ModuleHandlerInterface The module handler.

1 method overrides FilteredPluginManagerTrait::moduleHandler()
TestFilteredPluginManager::moduleHandler in core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php
Wraps the module handler.

File

core/lib/Drupal/Core/Plugin/FilteredPluginManagerTrait.php, line 53

Class

FilteredPluginManagerTrait
Provides a trait for plugin managers that allow filtering plugin definitions.

Namespace

Drupal\Core\Plugin

Code

protected function moduleHandler() {
  if (property_exists($this, 'moduleHandler') && $this->moduleHandler instanceof ModuleHandlerInterface) {
    return $this->moduleHandler;
  }
  return \Drupal::service('module_handler');
}