public function zip(\SplFileInfo $composerFile)
{
$json = json_decode(file_get_contents($composerFile), true);
if (false === isset($json['version'])) {
throw new \RuntimeException('Package "' . $json['name'] . '" has no version defined in file: ' . $composerFile->getPathname() . '.');
}
$packageZipPath = $this->getZipPath($json['name'], $json['version']);
if (false === file_exists($packageZipPath)) {
$this->createZip($composerFile, $packageZipPath);
}
$this->verifyZip($composerFile, $packageZipPath, $json);
return $packageZipPath;
}