Fix BC issue from #3101
parent
4f0d7e4739
commit
4bd748b463
|
@ -648,7 +648,17 @@ class Installer
|
|||
|
||||
private function createPolicy()
|
||||
{
|
||||
return new DefaultPolicy((!$this->update && $this->locker->isLocked()) ? $this->locker->getPreferStable() : $this->package->getPreferStable());
|
||||
$preferStable = null;
|
||||
if (!$this->update && $this->locker->isLocked()) {
|
||||
$preferStable = $this->locker->getPreferStable();
|
||||
}
|
||||
// old lock file without prefer stable will return null
|
||||
// so in this case we use the composer.json info
|
||||
if (null === $preferStable) {
|
||||
$preferStable = $this->package->getPreferStable();
|
||||
}
|
||||
|
||||
return new DefaultPolicy($preferStable);
|
||||
}
|
||||
|
||||
private function createRequest(Pool $pool, RootPackageInterface $rootPackage, PlatformRepository $platformRepo)
|
||||
|
|
|
@ -177,7 +177,7 @@ class Locker
|
|||
{
|
||||
$lockData = $this->getLockData();
|
||||
|
||||
return isset($lockData['prefer-stable']) ? $lockData['prefer-stable'] : false;
|
||||
return isset($lockData['prefer-stable']) ? $lockData['prefer-stable'] : null;
|
||||
}
|
||||
|
||||
public function getAliases()
|
||||
|
@ -210,6 +210,7 @@ class Locker
|
|||
* @param array $aliases array of aliases
|
||||
* @param string $minimumStability
|
||||
* @param array $stabilityFlags
|
||||
* @param bool $preferStable
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue