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.
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));
}
/**
return $result;
}
-
/**
* Triggers an E_USER_DEPRECATED error if any module implements the hook.
*
* {@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);
}
}