Phan\AST\ContextNode::getClosure PHP Method

getClosure() public method

public getClosure ( ) : Func
return Phan\Language\Element\Func
    public function getClosure() : Func
    {
        $closure_fqsen = FullyQualifiedFunctionName::fromClosureInContext($this->context);
        if (!$this->code_base->hasFunctionWithFQSEN($closure_fqsen)) {
            throw new CodeBaseException($closure_fqsen, "Could not find closure {$closure_fqsen}");
        }
        return $this->code_base->getFunctionByFQSEN($closure_fqsen);
    }