Phan\AST\Visitor\Element::acceptExecFlagVisitor PHP Method

acceptExecFlagVisitor() public method

Accepts a visitor that differentiates on the flag value of the AST node.
public acceptExecFlagVisitor ( Phan\AST\Visitor\FlagVisitor $visitor )
$visitor Phan\AST\Visitor\FlagVisitor
    public function acceptExecFlagVisitor(FlagVisitor $visitor)
    {
        switch ($this->node->flags) {
            case \ast\flags\EXEC_EVAL:
                return $visitor->visitExecEval($this->node);
            case \ast\flags\EXEC_INCLUDE:
                return $visitor->visitExecInclude($this->node);
            case \ast\flags\EXEC_INCLUDE_ONCE:
                return $visitor->visitExecIncludeOnce($this->node);
            case \ast\flags\EXEC_REQUIRE:
                return $visitor->visitExecRequire($this->node);
            case \ast\flags\EXEC_REQUIRE_ONCE:
                return $visitor->visitExecRequireOnce($this->node);
            default:
                assert(false, "All flags must match. Found " . Debug::astFlagDescription($this->node->flags ?? 0));
                break;
        }
    }