function ManifestDocumentMapper::map
File
-
vendor/
phar-io/ manifest/ src/ ManifestDocumentMapper.php, line 20
Class
Namespace
PharIo\ManifestCode
public function map(ManifestDocument $document) : Manifest {
try {
$contains = $document->getContainsElement();
$type = $this->mapType($contains);
$copyright = $this->mapCopyright($document->getCopyrightElement());
$requirements = $this->mapRequirements($document->getRequiresElement());
$bundledComponents = $this->mapBundledComponents($document);
return new Manifest(new ApplicationName($contains->getName()), new Version($contains->getVersion()), $type, $copyright, $requirements, $bundledComponents);
} catch (Throwable $e) {
throw new ManifestDocumentMapperException($e->getMessage(), (int) $e->getCode(), $e);
}
}