public visitClosure ( ast\Node\Decl $node ) : |
||
$node | ast\Node\Decl | A node of the type indicated by the method name that we'd like to figure out the type that it produces. |
return | The set of types that are possibly produced by the given node |
public function visitClosure(Decl $node) : UnionType
{
// The type of a closure is the fqsen pointing
// at its definition
$closure_fqsen = FullyQualifiedFunctionName::fromClosureInContext($this->context);
$type = CallableType::instanceWithClosureFQSEN($closure_fqsen)->asUnionType();
return $type;
}