original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Builds a URL with a different scheme
  @return Url
docstring_tokens: Builds a URL with a different scheme