Phan\AST\UnionTypeVisitor::visitClassConst PHP 메소드

visitClassConst() 공개 메소드

Visit a node with kind \ast\AST_CLASS_CONST
public visitClassConst ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
리턴 Phan\Language\UnionType The set of types that are possibly produced by the given node
    public function visitClassConst(Node $node) : UnionType
    {
        $constant_name = $node->children['const'];
        try {
            $constant = (new ContextNode($this->code_base, $this->context, $node))->getClassConst();
            return $constant->getUnionType();
        } catch (NodeException $exception) {
            $this->emitIssue(Issue::Unanalyzable, $node->lineno ?? 0);
        }
        return new UnionType();
    }