src/Url.php
public static function absolutizeUrl($url, $baseUrl)
    {
        $components = parse_url($baseUrl);

        if (empty($components[self::SCHEME]) || empty($components[self::HOST])) {
            throw new \InvalidArgumentException("Malformed baseUrl: {$baseUrl}");
        }

        return static::build($url, [
            's' => $components[self::SCHEME],
            'h' => $components[self::HOST],
        ]);
    }
public static function absolutizeUrl($url, $baseUrl)
    {
        $components = parse_url($baseUrl);

        if (empty($components[self::SCHEME]) || empty($components[self::HOST])) {
            throw new \InvalidArgumentException("Malformed baseUrl: {$baseUrl}");
        }

        return static::build($url, [
            's' => $components[self::SCHEME],
            'h' => $components[self::HOST],
        ]);
    }
Set (if not specified) scheme and host to $url based on $baseUrl

@param string $url
@param string $baseUrl
@return string absolutized version of $url