original_string: private function decomposeUrl($path_or_url)
      {
          $result = array();
  
          if (filter_var($path_or_url, FILTER_VALIDATE_URL)) {
              $url_parts = parse_url($path_or_url);
              $result['prefix'] = $url_parts['scheme'] . "://" . $url_parts['host'];
              $result['path'] = $url_parts['path'];
              $result['suffix'] = "";
              $result['suffix'] .= (empty($url_parts['query'])) ? "" : "?" . $url_parts['query'];
              $result['suffix'] .= (empty($url_parts['fragment'])) ? "" : "#" . $url_parts['fragment'];
          } else {
              $result['prefix'] = "";
              $result['path'] = $path_or_url;
              $result['suffix'] = "";
          }
  
          return $result;
      }
code: private function decomposeUrl($path_or_url)
      {
          $result = array();
  
          if (filter_var($path_or_url, FILTER_VALIDATE_URL)) {
              $url_parts = parse_url($path_or_url);
              $result['prefix'] = $url_parts['scheme'] . "://" . $url_parts['host'];
              $result['path'] = $url_parts['path'];
              $result['suffix'] = "";
              $result['suffix'] .= (empty($url_parts['query'])) ? "" : "?" . $url_parts['query'];
              $result['suffix'] .= (empty($url_parts['fragment'])) ? "" : "#" . $url_parts['fragment'];
          } else {
              $result['prefix'] = "";
              $result['path'] = $path_or_url;
              $result['suffix'] = "";
          }
  
          return $result;
      }
code_tokens: private function decomposeUrl ( $ path_or_url ) { $ result = array ( ) ; if ( filter_var ( $ path_or_url , FILTER_VALIDATE_URL ) ) { $ url_parts = parse_url ( $ path_or_url ) ; $ result [ 'prefix' ] = $ url_parts [ 'scheme' ] . "://" . $ url_parts [ 'host' ] ; $ result [ 'path' ] = $ url_parts [ 'path' ] ; $ result [ 'suffix' ] = "" ; $ result [ 'suffix' ] .= ( empty ( $ url_parts [ 'query' ] ) ) ? "" : "?" . $ url_parts [ 'query' ] ; $ result [ 'suffix' ] .= ( empty ( $ url_parts [ 'fragment' ] ) ) ? "" : "#" . $ url_parts [ 'fragment' ] ; } else { $ result [ 'prefix' ] = "" ; $ result [ 'path' ] = $ path_or_url ; $ result [ 'suffix' ] = "" ; } return $ result ; }
docstring: Decompose a url into a prefix, path, and suffix
  
  @param $path_or_url
  @return array
docstring_tokens: Decompose a url into a prefix path and suffix