/** * {@inheritdoc} */ public function migrate($targetVersion) { $previousVersion = $this->rootModuleFile->getVersion(); if ($previousVersion === $targetVersion) { return; } $this->rootModuleFile->setVersion($targetVersion); try { $this->jsonStorage->saveRootModuleFile($this->rootModuleFile); } catch (Exception $e) { $this->rootModuleFile->setVersion($previousVersion); throw $e; } }