Kahlan\Plugin\Double::_generateReturnType PHP Method

_generateReturnType() protected static method

Extract the return type of a method.
protected static _generateReturnType ( objedct $method ) : string
$method objedct A instance of `ReflectionMethod`.
return string The return type.
    protected static function _generateReturnType($method)
    {
        if (Suite::$PHP < 7) {
            return '';
        }
        $type = $method->getReturnType();
        if ($type) {
            if (!$type->isBuiltin()) {
                $type = '\\' . $type;
            }
            if (defined('HHVM_VERSION')) {
                $type = preg_replace('~\\\\?HH\\\\(mixed|void)?~', '', $type);
            }
        }
        return $type ? ": {$type} " : '';
    }