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

acceptUnaryFlagVisitor() public method

Accepts a visitor that differentiates on the flag value of the AST node.
public acceptUnaryFlagVisitor ( Phan\AST\Visitor\FlagVisitor $visitor )
$visitor Phan\AST\Visitor\FlagVisitor
    public function acceptUnaryFlagVisitor(FlagVisitor $visitor)
    {
        switch ($this->node->flags) {
            case \ast\flags\UNARY_BITWISE_NOT:
                return $visitor->visitUnaryBitwiseNot($this->node);
            case \ast\flags\UNARY_BOOL_NOT:
                return $visitor->visitUnaryBoolNot($this->node);
            case \ast\flags\UNARY_MINUS:
                return $visitor->visitUnaryMinus($this->node);
            case \ast\flags\UNARY_PLUS:
                return $visitor->visitUnaryPlus($this->node);
            case \ast\flags\UNARY_SILENCE:
                return $visitor->visitUnarySilence($this->node);
            default:
                assert(false, "All flags must match. Found " . Debug::astFlagDescription($this->node->flags ?? 0));
                break;
        }
    }