original_string: protected function marshalPath($path): string
      {
          if ( null === $path ) {
              $path = '/';
          }
  
          if ( ! is_string($path) ) {
              throw new UriException(
                  'Path must be a string or null'
              );
          }
  
          return preg_replace_callback(
              '/(?:[^'.self::$unreservedCharacters.self::$subDelimitedCharacters.'%:@\/]++|%(?![A-Fa-f0-9]{2}))/',
              function($match) {
                  return rawurlencode($match[0]);
              },
              $path
          );
      }
code: protected function marshalPath($path): string
      {
          if ( null === $path ) {
              $path = '/';
          }
  
          if ( ! is_string($path) ) {
              throw new UriException(
                  'Path must be a string or null'
              );
          }
  
          return preg_replace_callback(
              '/(?:[^'.self::$unreservedCharacters.self::$subDelimitedCharacters.'%:@\/]++|%(?![A-Fa-f0-9]{2}))/',
              function($match) {
                  return rawurlencode($match[0]);
              },
              $path
          );
      }
code_tokens: protected function marshalPath ( $ path ) : string { if ( null === $ path ) { $ path = '/' ; } if ( ! is_string ( $ path ) ) { throw new UriException ( 'Path must be a string or null' ) ; } return preg_replace_callback ( '/(?:[^' . self :: $ unreservedCharacters . self :: $ subDelimitedCharacters . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/' , function ( $ match ) { return rawurlencode ( $ match [ 0 ] ) ; } , $ path ) ; }
docstring: marshals the path.
  
  @param $path
  @return string
  @throws UriException
docstring_tokens: marshals the path .