/**
* {@inheritdoc}
*/
public function removeModule($name)
{
// Only check that this is a string. The error message "not found" is
// more helpful than e.g. "module name must contain /".
Assert::string($name, 'The module name must be a string. Got: %s');
$this->assertModulesLoaded();
if ($this->rootModuleFile->hasInstallInfo($name)) {
$installInfo = $this->rootModuleFile->getInstallInfo($name);
$this->rootModuleFile->removeInstallInfo($name);
try {
$this->moduleFileStorage->saveRootModuleFile($this->rootModuleFile);
} catch (Exception $e) {
$this->rootModuleFile->addInstallInfo($installInfo);
throw $e;
}
}
$this->modules->remove($name);
}