本文整理汇总了PHP中phpDocumentor\Reflection\DocBlock\Tag::getContent方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::getContent方法的具体用法?PHP Tag::getContent怎么用?PHP Tag::getContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpDocumentor\Reflection\DocBlock\Tag
的用法示例。
在下文中一共展示了Tag::getContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testConstructorParesInputsIntoCorrectFields
/**
* Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can
* understand the @var doc block.
*
* @param string $type
* @param string $content
* @param string $exDescription
*
* @covers \phpDocumentor\Reflection\DocBlock\Tag
* @dataProvider provideDataForConstuctor
*
* @return void
*/
public function testConstructorParesInputsIntoCorrectFields($type, $content, $exDescription)
{
$tag = new Tag($type, $content);
$this->assertEquals($type, $tag->getName());
$this->assertEquals($content, $tag->getContent());
$this->assertEquals($exDescription, $tag->getDescription());
}
示例2: resolve
/**
* @param string $type
* @param DocBlock\Tag $tag
* @return string|null
*/
private function resolve($type, DocBlock\Tag $tag)
{
if (strpos($type, '\\') === 0) {
$type = rtrim($type, '[]');
$tagName = new Node\Name(trim($type, '\\'));
if (strpos($tag->getContent(), $type) === false) {
$tagName = $this->resolveClassName($tagName);
}
return $tagName->toString();
}
return null;
}
示例3: 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;
}