protected function convertUrl($url, $https)
    {
        $scheme = ($https) ? 'https' : 'http';
        $parser = new Url($url);
        $parser->setScheme($scheme);

        return $parser->__toString();
    }
protected function convertUrl($url, $https)
    {
        $scheme = ($https) ? 'https' : 'http';
        $parser = new Url($url);
        $parser->setScheme($scheme);

        return $parser->__toString();
    }
protected function convertUrl ( $ url , $ https ) { $ scheme = ( $ https ) ? 'https' : 'http' ; $ parser = new Url ( $ url ) ; $ parser -> setScheme ( $ scheme ) ; return $ parser -> __toString ( ) ; }
Convert URL from HTTP to HTTPS and vice versa.

@param string $url
@param bool   $https

@return string
Convert URL from HTTP to HTTPS and vice versa .