Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ManifestDocumentMapper.php

function ManifestDocumentMapper::map

File

vendor/phar-io/manifest/src/ManifestDocumentMapper.php, line 20

Class

ManifestDocumentMapper

Namespace

PharIo\Manifest

Code

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);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal