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

Breadcrumb

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

function ManifestSerializer::addContains

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

File

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

Class

ManifestSerializer
@psalm-suppress MissingConstructor

Namespace

PharIo\Manifest

Code

private function addContains(ApplicationName $name, Version $version, Type $type) : void {
    $this->xmlWriter
        ->startElement('contains');
    $this->xmlWriter
        ->writeAttribute('name', $name->asString());
    $this->xmlWriter
        ->writeAttribute('version', $version->getVersionString());
    switch (true) {
        case $type->isApplication():
            $this->xmlWriter
                ->writeAttribute('type', 'application');
            break;
        case $type->isLibrary():
            $this->xmlWriter
                ->writeAttribute('type', 'library');
            break;
        case $type->isExtension():
            $this->xmlWriter
                ->writeAttribute('type', 'extension');
            
            /* @var $type Extension */
            $this->addExtension($type->getApplicationName(), $type->getVersionConstraint());
            break;
        default:
            $this->xmlWriter
                ->writeAttribute('type', 'custom');
    }
    $this->xmlWriter
        ->endElement();
}

API Navigation

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