src/Common/Internal/Utilities.php
public static function tryAddUrlScheme($url, $scheme = 'http')
    {
        $urlScheme = parse_url($url, PHP_URL_SCHEME);

        if (empty($urlScheme)) {
            $url = "$scheme://".$url;
        }

        return $url;
    }
public static function tryAddUrlScheme($url, $scheme = 'http')
    {
        $urlScheme = parse_url($url, PHP_URL_SCHEME);

        if (empty($urlScheme)) {
            $url = "$scheme://".$url;
        }

        return $url;
    }
public static function tryAddUrlScheme ( $ url , $ scheme = 'http' ) { $ urlScheme = parse_url ( $ url , PHP_URL_SCHEME ) ; if ( empty ( $ urlScheme ) ) { $ url = "$scheme://" . $ url ; } return $ url ; }
Adds a url scheme if there is no scheme.

@param string $url    The URL
@param string $scheme The scheme. By default HTTP

@static

@return string
Adds a url scheme if there is no scheme .