getDocBlock() public method

Gets the docblock this tag belongs to.
public getDocBlock ( ) : DocBlock
return phpDocumentor\Reflection\DocBlock The docblock this tag belongs to.
Esempio n. 1
0
 /**
  * Appends a tag at the end of the list of tags.
  *
  * @param Tag $tag The tag to add.
  *
  * @return Tag The newly added tag.
  *
  * @throws \LogicException When the tag belongs to a different DocBlock.
  */
 public function appendTag(Tag $tag)
 {
     if (null === $tag->getDocBlock()) {
         $tag->setDocBlock($this);
     }
     if ($tag->getDocBlock() === $this) {
         $this->tags[] = $tag;
     } else {
         throw new \LogicException('This tag belongs to a different DocBlock object.');
     }
     return $tag;
 }
Esempio n. 2
0
 /**
  * Creates (or keeps) a Tag from a phpDocumentor Tag.
  *  If a custom Tag class was registered, it has priority.
  * @param Tag $tag
  * @return Tag
  */
 protected function createTagAnnotation(Tag $tag)
 {
     $name = $tag->getName();
     // If our own map of tags doesn't have a registered class, keep the original tag.
     if (isset($this->tagClassNameMap[$name])) {
         $tagClassName = $this->tagClassNameMap[$name];
         $annotationTag = new $tagClassName($tag->getName(), $tag->getContent(), $tag->getDocBlock(), $tag->getLocation());
     } else {
         $annotationTag = $tag;
     }
     return $annotationTag;
 }