protected getReturnTypeFromDocBlock ( ReflectionMethod $reflection ) : null | string | ||
$reflection | ReflectionMethod | |
return | null | string |
protected function getReturnTypeFromDocBlock(\ReflectionMethod $reflection)
{
$type = null;
$phpdoc = new DocBlock($reflection);
if ($phpdoc->hasTag('return')) {
$type = $phpdoc->getTagsByName('return')[0]->getContent();
}
return $type;
}