original_string: public static function dir($sourcePath, $outZipPath)
      {
          $sourcePath = rtrim($sourcePath, "/");
          $zip = new ZipArchive();
          $zip->open($outZipPath, ZipArchive::CREATE);
          self::folderToZip($sourcePath, $zip, strlen($sourcePath . "/"));
          $zip->close();
      }
code: public static function dir($sourcePath, $outZipPath)
      {
          $sourcePath = rtrim($sourcePath, "/");
          $zip = new ZipArchive();
          $zip->open($outZipPath, ZipArchive::CREATE);
          self::folderToZip($sourcePath, $zip, strlen($sourcePath . "/"));
          $zip->close();
      }
code_tokens: public static function dir ( $ sourcePath , $ outZipPath ) { $ sourcePath = rtrim ( $ sourcePath , "/" ) ; $ zip = new ZipArchive ( ) ; $ zip -> open ( $ outZipPath , ZipArchive :: CREATE ) ; self :: folderToZip ( $ sourcePath , $ zip , strlen ( $ sourcePath . "/" ) ) ; $ zip -> close ( ) ; }
docstring: Zip a folder
  
  @param string $sourcePath Path of directory to be zip.
  @param string $outZipPath Path of output zip file.
docstring_tokens: Zip a folder