X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FExtension%2FModuleHandler.php;fp=web%2Fcore%2Flib%2FDrupal%2FCore%2FExtension%2FModuleHandler.php;h=8d43a857dd4c7a678ad190456b2ed14dcfe0b74e;hp=7d69c3cb82ba82b64a8f6bb757fcd9fbeec87595;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/lib/Drupal/Core/Extension/ModuleHandler.php b/web/core/lib/Drupal/Core/Extension/ModuleHandler.php index 7d69c3cb8..8d43a857d 100644 --- a/web/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/web/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -5,6 +5,7 @@ namespace Drupal\Core\Extension; use Drupal\Component\Graph\Graph; use Drupal\Component\Utility\NestedArray; use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\Core\Extension\Exception\UnknownExtensionException; /** * Class that manages modules in a Drupal installation. @@ -172,7 +173,7 @@ class ModuleHandler implements ModuleHandlerInterface { if (isset($this->moduleList[$name])) { return $this->moduleList[$name]; } - throw new \InvalidArgumentException(sprintf('The module %s does not exist.', $name)); + throw new UnknownExtensionException(sprintf('The module %s does not exist.', $name)); } /** @@ -429,7 +430,6 @@ class ModuleHandler implements ModuleHandlerInterface { return $result; } - /** * Triggers an E_USER_DEPRECATED error if any module implements the hook. * @@ -777,8 +777,7 @@ class ModuleHandler implements ModuleHandlerInterface { * {@inheritdoc} */ public function getName($module) { - $info = system_get_info('module', $module); - return isset($info['name']) ? $info['name'] : $module; + return \Drupal::service('extension.list.module')->getName($module); } }