original_string: public function swapDirectoryFilter($path_or_url, $directory)
      {
  
          $path = $this->decomposeUrl($path_or_url);
          $path_parts = pathinfo($path['path']);
          $new_path = $directory . DIRECTORY_SEPARATOR . $path_parts['basename'];
  
          $output = $path['prefix'] . $new_path . $path['suffix'];
          return $output;
      }
code: public function swapDirectoryFilter($path_or_url, $directory)
      {
  
          $path = $this->decomposeUrl($path_or_url);
          $path_parts = pathinfo($path['path']);
          $new_path = $directory . DIRECTORY_SEPARATOR . $path_parts['basename'];
  
          $output = $path['prefix'] . $new_path . $path['suffix'];
          return $output;
      }
code_tokens: public function swapDirectoryFilter ( $ path_or_url , $ directory ) { $ path = $ this -> decomposeUrl ( $ path_or_url ) ; $ path_parts = pathinfo ( $ path [ 'path' ] ) ; $ new_path = $ directory . DIRECTORY_SEPARATOR . $ path_parts [ 'basename' ] ; $ output = $ path [ 'prefix' ] . $ new_path . $ path [ 'suffix' ] ; return $ output ; }
docstring: Swap the file directory on a passed url or path
  
  @param $path_or_url
  @param $directory
  @return string
docstring_tokens: Swap the file directory on a passed url or path