/** * {@inheritdoc} */ public function unserializePackageFile($serialized, $path = null) { $packageFile = new PackageFile(null, $path); $jsonData = $this->decode($serialized, $path); // Remember original version of the package file $packageFile->setVersion($jsonData->version); // Migrate to the expected version $this->migrationManager->migrate($jsonData, $this->targetVersion); $this->jsonToPackageFile($jsonData, $packageFile); return $packageFile; }