本文整理汇总了PHP中phpDocumentor\Reflection\DocBlock\Tag::getDocBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::getDocBlock方法的具体用法?PHP Tag::getDocBlock怎么用?PHP Tag::getDocBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpDocumentor\Reflection\DocBlock\Tag
的用法示例。
在下文中一共展示了Tag::getDocBlock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: appendTag
/**
* 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;
}
示例2: createTagAnnotation
/**
* 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;
}