You are here

public function XmlDescriptor::getInputDefinitionDocument in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Descriptor/XmlDescriptor.php \Symfony\Component\Console\Descriptor\XmlDescriptor::getInputDefinitionDocument()

Parameters

InputDefinition $definition:

Return value

\DOMDocument

2 calls to XmlDescriptor::getInputDefinitionDocument()
XmlDescriptor::describeInputDefinition in vendor/symfony/console/Descriptor/XmlDescriptor.php
Describes an InputDefinition instance.
XmlDescriptor::getCommandDocument in vendor/symfony/console/Descriptor/XmlDescriptor.php

File

vendor/symfony/console/Descriptor/XmlDescriptor.php, line 34

Class

XmlDescriptor
XML descriptor.

Namespace

Symfony\Component\Console\Descriptor

Code

public function getInputDefinitionDocument(InputDefinition $definition) {
  $dom = new \DOMDocument('1.0', 'UTF-8');
  $dom
    ->appendChild($definitionXML = $dom
    ->createElement('definition'));
  $definitionXML
    ->appendChild($argumentsXML = $dom
    ->createElement('arguments'));
  foreach ($definition
    ->getArguments() as $argument) {
    $this
      ->appendDocument($argumentsXML, $this
      ->getInputArgumentDocument($argument));
  }
  $definitionXML
    ->appendChild($optionsXML = $dom
    ->createElement('options'));
  foreach ($definition
    ->getOptions() as $option) {
    $this
      ->appendDocument($optionsXML, $this
      ->getInputOptionDocument($option));
  }
  return $dom;
}