src/Url.php
public function getUrlForScheme($scheme)
    {
        $newUrl = clone $this;

        $wasDefaultPort = ($newUrl->hasScheme() && $newUrl->isPortDefault());

        $newUrl->_fragments['scheme'] = $scheme;
        if ($wasDefaultPort) {
            $newUrl->_fragments['port'] = $newUrl->getDefaultPort();
        }

        $newUrl->_inputString = $newUrl->__toString();

        return $newUrl;
    }
public function getUrlForScheme($scheme)
    {
        $newUrl = clone $this;

        $wasDefaultPort = ($newUrl->hasScheme() && $newUrl->isPortDefault());

        $newUrl->_fragments['scheme'] = $scheme;
        if ($wasDefaultPort) {
            $newUrl->_fragments['port'] = $newUrl->getDefaultPort();
        }

        $newUrl->_inputString = $newUrl->__toString();

        return $newUrl;
    }
public function getUrlForScheme ( $ scheme ) { $ newUrl = clone $ this ; $ wasDefaultPort = ( $ newUrl -> hasScheme ( ) && $ newUrl -> isPortDefault ( ) ) ; $ newUrl -> _fragments [ 'scheme' ] = $ scheme ; if ( $ wasDefaultPort ) { $ newUrl -> _fragments [ 'port' ] = $ newUrl -> getDefaultPort ( ) ; } $ newUrl -> _inputString = $ newUrl -> __toString ( ) ; return $ newUrl ; }
Builds a URL with a different scheme
@return Url
Builds a URL with a different scheme