original_string: public function buildZip($file, $basePath)
      {
          yield 'Generating zip file ' . $file;
  
          $zip = new \ZipArchive();
          $res = $zip->open($file, \ZipArchive::CREATE);
  
          if ($res === true) {
              $this->buildZipArchive($basePath, $zip, $basePath, 0);
              $zip->close();
  
              yield 'Generation completed file size ' . (round(filesize($file) / 1024, 2)) . 'kb';
          } else {
              throw new \RuntimeException('Could not create zip file ' . $file);
          }
      }
code: public function buildZip($file, $basePath)
      {
          yield 'Generating zip file ' . $file;
  
          $zip = new \ZipArchive();
          $res = $zip->open($file, \ZipArchive::CREATE);
  
          if ($res === true) {
              $this->buildZipArchive($basePath, $zip, $basePath, 0);
              $zip->close();
  
              yield 'Generation completed file size ' . (round(filesize($file) / 1024, 2)) . 'kb';
          } else {
              throw new \RuntimeException('Could not create zip file ' . $file);
          }
      }
code_tokens: public function buildZip ( $ file , $ basePath ) { yield 'Generating zip file ' . $ file ; $ zip = new \ ZipArchive ( ) ; $ res = $ zip -> open ( $ file , \ ZipArchive :: CREATE ) ; if ( $ res === true ) { $ this -> buildZipArchive ( $ basePath , $ zip , $ basePath , 0 ) ; $ zip -> close ( ) ; yield 'Generation completed file size ' . ( round ( filesize ( $ file ) / 1024 , 2 ) ) . 'kb' ; } else { throw new \ RuntimeException ( 'Could not create zip file ' . $ file ) ; } }
docstring: Creates a zip archive for the provided file using all files located at
  the base path
  
  @param string $file
  @param string $basePath
  @return \Generator
docstring_tokens: Creates a zip archive for the provided file using all files located at the base path