/**
  * Export this tag to the given DocBlock.
  *
  * @param \DOMElement                                  $parent  Element to
  *     augment.
  * @param \phpDocumentor\Reflection\DocBlock\Tag       $tag     The tag to
  *     export.
  * @param \phpDocumentor\Reflection\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\\Plugin\\EventDispatcher')) {
         \phpDocumentor\Plugin\EventDispatcher::getInstance()->dispatch('reflection.docblock.tag.export', \phpDocumentor\Reflection\Events\ExportDocBlockTagEvent::createInstance($element)->setObject($tag)->setXml(simplexml_import_dom($child)));
     }
 }
예제 #2
0
 /**
  * Prepare the tag to be injected into the XML file.
  *
  * @param \phpDocumentor\Reflection\Events\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());
 }