本文整理匯總了PHP中PhpParser\Node\Stmt::getType方法的典型用法代碼示例。如果您正苦於以下問題:PHP Stmt::getType方法的具體用法?PHP Stmt::getType怎麽用?PHP Stmt::getType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PhpParser\Node\Stmt
的用法示例。
在下文中一共展示了Stmt::getType方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: verifyNotControlStructure
private function verifyNotControlStructure(Node\Stmt $node)
{
$nodeType = str_replace('Stmt_', '', $node->getType());
if (isset(self::$constructStructureMap[$nodeType])) {
throw ASTException::containsControlStructure(self::$constructStructureMap[$nodeType], $node->getAttribute('startLine'));
}
}
示例2: addClassOrInterface
protected function addClassOrInterface(StmtNode $node)
{
$class = new ClassReflection((string) $node->namespacedName, $node->getLine());
$class->setModifiers($node->getType());
$class->setNamespace($this->context->getNamespace());
$class->setAliases($this->context->getAliases());
$class->setHash($this->context->getHash());
$class->setFile($this->context->getFile());
$comment = $this->context->getDocBlockParser()->parse($node->getDocComment(), $this->context, $class);
$class->setDocComment($node->getDocComment());
$class->setShortDesc($comment->getShortDesc());
$class->setLongDesc($comment->getLongDesc());
if ($errors = $comment->getErrors()) {
$class->setErrors($errors);
} else {
$class->setTags($comment->getOtherTags());
}
if ($this->context->getFilter()->acceptClass($class)) {
if ($errors) {
$this->context->addErrors((string) $class, $node->getLine(), $errors);
}
$this->context->enterClass($class);
}
return $class;
}