diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index 2a2113ff13..4e0bf9bfea 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -777,6 +777,8 @@ public function getModuleDirectories() { * {@inheritdoc} */ public function getName($module) { + @trigger_error('getName($module) is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Extension\ModuleExtensionList::getName($module). See https://www.drupal.org/node/2709919.', E_USER_DEPRECATED); + \Drupal::service('extension.list.module')->getName($module); return \Drupal::service('extension.list.module')->getName($module); } diff --git a/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php b/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php index 725433bfc5..0c4d16a4f8 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php @@ -401,9 +401,6 @@ public function getModuleDirectories(); * Returns the human readable name of the module or the machine name passed * in if no matching module is found. */ - public function getName($module) { - @trigger_error('getName($module) is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Extension\ModuleExtensionList::getName($module). See https://www.drupal.org/node/2709919.', E_USER_DEPRECATED); - \Drupal::service('extension.list.module')->getName($module); - } + public function getName($module); }