Phan\Analysis\PreOrderAnalysisVisitor::visitIfElem PHP Метод

visitIfElem() публичный Метод

public visitIfElem ( ast\Node $node ) : Context
$node ast\Node A node to parse
Результат Phan\Language\Context A new or an unchanged context resulting from parsing the node
    public function visitIfElem(Node $node) : Context
    {
        if (!isset($node->children['cond']) || !$node->children['cond'] instanceof Node) {
            return $this->context;
        }
        // Get the type just to make sure everything
        // is defined.
        $expression_type = UnionType::fromNode($this->context, $this->code_base, $node->children['cond']);
        // Look to see if any proofs we do within the condition
        // can say anything about types within the statement
        // list.
        return (new ConditionVisitor($this->code_base, $this->context))($node->children['cond']);
    }