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

Breadcrumb

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

function ManifestSerializer::addCopyright

1 call to ManifestSerializer::addCopyright()
ManifestSerializer::serializeToString in vendor/phar-io/manifest/src/ManifestSerializer.php

File

vendor/phar-io/manifest/src/ManifestSerializer.php, line 100

Class

ManifestSerializer
@psalm-suppress MissingConstructor

Namespace

PharIo\Manifest

Code

private function addCopyright(CopyrightInformation $copyrightInformation) : void {
    $this->xmlWriter
        ->startElement('copyright');
    foreach ($copyrightInformation->getAuthors() as $author) {
        $this->xmlWriter
            ->startElement('author');
        $this->xmlWriter
            ->writeAttribute('name', $author->getName());
        $this->xmlWriter
            ->writeAttribute('email', $author->getEmail()
            ->asString());
        $this->xmlWriter
            ->endElement();
    }
    $license = $copyrightInformation->getLicense();
    $this->xmlWriter
        ->startElement('license');
    $this->xmlWriter
        ->writeAttribute('type', $license->getName());
    $this->xmlWriter
        ->writeAttribute('url', $license->getUrl()
        ->asString());
    $this->xmlWriter
        ->endElement();
    $this->xmlWriter
        ->endElement();
}

API Navigation

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