Barryvdh\LaravelIdeHelper\Console\ModelsCommand::getReturnTypeFromDocBlock PHP 메소드

getReturnTypeFromDocBlock() 보호된 메소드

Get method return type based on it DocBlock comment
protected getReturnTypeFromDocBlock ( ReflectionMethod $reflection ) : null | string
$reflection ReflectionMethod
리턴 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;
    }