original_string: protected function setUrlScheme($url, $scheme = '')
      {
          if (!($url = (string) $url)) {
              return $url; // Nothing to do.
          }
          $scheme = (string) $scheme;
  
          if (!$scheme) {
              $scheme = $this->currentUrlScheme();
          }
          if ($scheme !== '//') {
              $scheme = $this->nUrlScheme($scheme).'://';
          }
          return preg_replace('/^(?:[a-z0-9]+\:)?\/\//ui', $this->escRefs($scheme), $url);
      }
code: protected function setUrlScheme($url, $scheme = '')
      {
          if (!($url = (string) $url)) {
              return $url; // Nothing to do.
          }
          $scheme = (string) $scheme;
  
          if (!$scheme) {
              $scheme = $this->currentUrlScheme();
          }
          if ($scheme !== '//') {
              $scheme = $this->nUrlScheme($scheme).'://';
          }
          return preg_replace('/^(?:[a-z0-9]+\:)?\/\//ui', $this->escRefs($scheme), $url);
      }
code_tokens: protected function setUrlScheme ( $ url , $ scheme = '' ) { if ( ! ( $ url = ( string ) $ url ) ) { return $ url ; // Nothing to do. } $ scheme = ( string ) $ scheme ; if ( ! $ scheme ) { $ scheme = $ this -> currentUrlScheme ( ) ; } if ( $ scheme !== '//' ) { $ scheme = $ this -> nUrlScheme ( $ scheme ) . '://' ; } return preg_replace ( '/^(?:[a-z0-9]+\:)?\/\//ui' , $ this -> escRefs ( $ scheme ) , $ url ) ; }
docstring: Sets a particular scheme.
  
  @since 140417 Initial release.
  
  @param string $url    A full URL.
  @param string $scheme Optional. The scheme to use (i.e. `//`, `https`, `http`).
  Use `//` to use a cross-protocol compatible scheme.
  Defaults to the current scheme.
  
  @return string The full URL w/ `$scheme`.
docstring_tokens: Sets a particular scheme .