本文整理汇总了PHP中XHPASTNode::getDocblockToken方法的典型用法代码示例。如果您正苦于以下问题:PHP XHPASTNode::getDocblockToken方法的具体用法?PHP XHPASTNode::getDocblockToken怎么用?PHP XHPASTNode::getDocblockToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XHPASTNode
的用法示例。
在下文中一共展示了XHPASTNode::getDocblockToken方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findAtomDocblock
private function findAtomDocblock(DivinerAtom $atom, XHPASTNode $node)
{
$token = $node->getDocblockToken();
if ($token) {
$atom->setDocblockRaw($token->getValue());
return true;
} else {
$tokens = $node->getTokens();
if ($tokens) {
$prev = head($tokens);
while ($prev = $prev->getPrevToken()) {
if ($prev->isAnyWhitespace()) {
continue;
}
break;
}
if ($prev && $prev->isComment()) {
$value = $prev->getValue();
$matches = null;
if (preg_match('/@(return|param|task|author)/', $value, $matches)) {
$atom->addWarning(pht('Atom "%s" is preceded by a comment containing `%s`, but ' . 'the comment is not a documentation comment. Documentation ' . 'comments must begin with `%s`, followed by a newline. Did ' . 'you mean to use a documentation comment? (As the comment is ' . 'not a documentation comment, it will be ignored.)', $atom->getName(), '@' . $matches[1], '/**'));
}
}
}
$atom->setDocblockRaw('');
return false;
}
}