/**
  * Export this tag to the given DocBlock.
  *
  * This method also invokes the 'reflection.docblock.tag.export' which can
  * be used to augment the data. This is useful for plugins so that they
  * can provide custom tags.
  *
  * @param \DOMElement   $parent  Element to augment.
  * @param Tag           $tag     The tag to export.
  * @param BaseReflector $element Element to log from.
  *
  * @return void
  */
 public function export(\DOMElement $parent, $tag, $element)
 {
     $child = new \DOMElement('tag');
     $parent->appendChild($child);
     $child->setAttribute('line', $parent->getAttribute('line'));
     if (class_exists('phpDocumentor\\Event\\Dispatcher')) {
         \phpDocumentor\Event\Dispatcher::getInstance()->dispatch('reflection.docblock.tag.export', \phpDocumentor\Reflection\Event\ExportDocBlockTagEvent::createInstance($element)->setObject($tag)->setXml($child));
     }
 }
Beispiel #2
0
 /**
  * Prepare the tag to be injected into the XML file.
  *
  * @param ExportDocBlockTagEvent $data Event object containing the parameters.
  *
  * @phpdoc-event reflection.docblock.tag.export
  *
  * @return void
  */
 public function exportTag($data)
 {
     /** @var \phpDocumentor\Reflection\BaseReflector $subject  */
     $subject = $data->getSubject();
     Parser\DocBlock\Tag\Definition\Definition::create($subject->getNamespace(), $subject->getNamespaceAliases(), $data->getXml(), $data->getObject());
 }