src/Plugin/Double.php
protected static function _generateReturnType($method)
    {
        if (Suite::$PHP < 7) {
            return '';
        }
        $type = $method->getReturnType();
        $allowsNull = '';
        if ($type) {
            if (method_exists($type, 'allowsNull') && $type->allowsNull()) {
                $allowsNull = '?';
            }
            if (!$type->isBuiltin()) {
                $type = '\\' . $type;
            }
            if (defined('HHVM_VERSION')) {
                $type = preg_replace('~\\\?HH\\\(mixed|void)?~', '', $type);
            }
        }
        return $type ? ": {$allowsNull}{$type} " : '';
    }
protected static function _generateReturnType($method)
    {
        if (Suite::$PHP < 7) {
            return '';
        }
        $type = $method->getReturnType();
        $allowsNull = '';
        if ($type) {
            if (method_exists($type, 'allowsNull') && $type->allowsNull()) {
                $allowsNull = '?';
            }
            if (!$type->isBuiltin()) {
                $type = '\\' . $type;
            }
            if (defined('HHVM_VERSION')) {
                $type = preg_replace('~\\\?HH\\\(mixed|void)?~', '', $type);
            }
        }
        return $type ? ": {$allowsNull}{$type} " : '';
    }
protected static function _generateReturnType ( $ method ) { if ( Suite :: $ PHP < 7 ) { return '' ; } $ type = $ method -> getReturnType ( ) ; $ allowsNull = '' ; if ( $ type ) { if ( method_exists ( $ type , 'allowsNull' ) && $ type -> allowsNull ( ) ) { $ allowsNull = '?' ; } if ( ! $ type -> isBuiltin ( ) ) { $ type = '\\' . $ type ; } if ( defined ( 'HHVM_VERSION' ) ) { $ type = preg_replace ( '~\\\?HH\\\(mixed|void)?~' , '' , $ type ) ; } } return $ type ? ": {$allowsNull}{$type} " : '' ; }
Extract the return type of a method.

@param  object $method A instance of `ReflectionMethod`.
@return string         The return type.
Extract the return type of a method .