/**
  * Saves a root package file.
  *
  * The package file is saved to the same path that it was read from.
  *
  * @param RootPackageFile $packageFile The package file to save.
  *
  * @throws IOException If the file cannot be written.
  */
 public function saveRootPackageFile(RootPackageFile $packageFile)
 {
     $this->writer->writePackageFile($packageFile, $packageFile->getPath());
     if ($this->factoryManager) {
         $this->factoryManager->autoGenerateFactoryClass();
     }
 }