}
/**
- * Returns the appropriate update instructions to update the given package,
+ * Returns the appropriate update instructions to update the given package version,
* `null` if no appropriate instruction could be found.
*
* @since 6.0
*/
- public function getUpdateInstructionsFor(Package $package): ?array
+ public function getUpdateInstructionsFor(string $version): ?array
{
foreach ($this->instructions['update'] as $fromVersion => $instructions) {
- if (Package::checkFromversion($package->packageVersion, $fromVersion)) {
+ if (Package::checkFromversion($version, $fromVersion)) {
return $instructions;
}
}
}
} else {
// package is already installed, check update path
- $instructions = $this->archive->getUpdateInstructionsFor($package);
+ $instructions = $this->archive->getUpdateInstructionsFor($package->packageVersion);
if ($instructions === null) {
$deliveredPackageVersion = $this->archive->getPackageInfo('version');