/**
* Loads the module file for the module at the given install path.
*
* @param string $installPath The absolute install path of the module
*
* @return ModuleFile|null The loaded module file or `null` if none
* could be found.
*/
private function loadModuleFile($installPath)
{
if (!file_exists($installPath)) {
throw FileNotFoundException::forPath($installPath);
}
if (!is_dir($installPath)) {
throw new NoDirectoryException(sprintf('The path %s is a file. Expected a directory.', $installPath));
}
try {
return $this->jsonStorage->loadModuleFile($installPath . '/puli.json');
} catch (FileNotFoundException $e) {
// Modules without module files are ok
return null;
}
}