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\ManifestCode
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();
}