original_string: protected function _encodeUrl($url)
      {
          $path = parse_url($url, PHP_URL_PATH);
          $parts = array_map('rawurldecode', explode('/', $path));
          $parts = array_map('rawurlencode', $parts);
          $encoded = implode('/', $parts);
  
          /** @var string $url */
          $url = h(str_replace($path, $encoded, $url));
  
          return $url;
      }
code: protected function _encodeUrl($url)
      {
          $path = parse_url($url, PHP_URL_PATH);
          $parts = array_map('rawurldecode', explode('/', $path));
          $parts = array_map('rawurlencode', $parts);
          $encoded = implode('/', $parts);
  
          /** @var string $url */
          $url = h(str_replace($path, $encoded, $url));
  
          return $url;
      }
code_tokens: protected function _encodeUrl ( $ url ) { $ path = parse_url ( $ url , PHP_URL_PATH ) ; $ parts = array_map ( 'rawurldecode' , explode ( '/' , $ path ) ) ; $ parts = array_map ( 'rawurlencode' , $ parts ) ; $ encoded = implode ( '/' , $ parts ) ; /** @var string $url */ $ url = h ( str_replace ( $ path , $ encoded , $ url ) ) ; return $ url ; }
docstring: Encodes a URL for use in HTML attributes.
  
  @param string $url The URL to encode.
  @return string The URL encoded for both URL & HTML contexts.
docstring_tokens: Encodes a URL for use in HTML attributes .