diff --git a/core/modules/help/lib/Drupal/help/Controller/HelpController.php b/core/modules/help/lib/Drupal/help/Controller/HelpController.php index c35d48f..c020b51 100644 --- a/core/modules/help/lib/Drupal/help/Controller/HelpController.php +++ b/core/modules/help/lib/Drupal/help/Controller/HelpController.php @@ -7,6 +7,7 @@ namespace Drupal\help\Controller; use Drupal\Core\ControllerInterface; +use Drupal\Core\Extension\ModuleHandler; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -15,10 +16,24 @@ class HelpController implements ControllerInterface { /** + * Stores the Module handler. + * + * @var \Drupal\Core\Extension\ModuleHandler + */ + protected $moduleHandler; + + /** + * Constructs a HelpController object. + */ + public function __construct(ModuleHandler $module_handler) { + $this->moduleHandler = $module_handler; + } + + /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { - return new static(); + return new static($container->get('module_handler')); } /** @@ -42,8 +57,8 @@ private function helpLinksAsList() { $module_info = system_rebuild_module_data(); $modules = array(); - foreach (module_implements('help') as $module) { - if (module_invoke($module, 'help', "admin/help#$module", $empty_arg)) { + foreach ($this->moduleHandler->getImplementations('help') as $module) { + if ($this->moduleHandler->invoke($module, 'help', array("admin/help#$module", $empty_arg))) { $modules[$module] = $module_info[$module]->info['name']; } } @@ -65,6 +80,4 @@ private function helpLinksAsList() { return $output; } - - }