BetterReflection\TypesFinder\FindReturnType::__invoke PHP Метод

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

Given a function, attempt to find the return type.
public __invoke ( ReflectionFunctionAbstract $function ) : phpDocumentor\Reflection\Type[]
$function BetterReflection\Reflection\ReflectionFunctionAbstract
Результат phpDocumentor\Reflection\Type[]
    public function __invoke(ReflectionFunctionAbstract $function)
    {
        $context = $this->createContextForFunction($function);
        $returnTags = DocBlockFactory::createInstance()->create($function->getDocComment(), new Context($context->getNamespace(), $context->getNamespaceAliases()))->getTagsByName('return');
        foreach ($returnTags as $returnTag) {
            /* @var $returnTag \phpDocumentor\Reflection\DocBlock\Tags\Return_ */
            return (new ResolveTypes())->__invoke(explode('|', $returnTag->getType()), $context);
        }
        return [];
    }