mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
fix based on test, fixes #5724
This commit is contained in:
parent
9f2bd34c87
commit
710bb0d008
1 changed files with 12 additions and 2 deletions
|
@ -71,11 +71,21 @@ class VersionSelector
|
|||
$candidatePriority = $candidate->getStabilityPriority();
|
||||
$currentPriority = $package->getStabilityPriority();
|
||||
|
||||
// candidate is less stable than our preferred stability, and we have a package that is more stable than it, so we skip it
|
||||
// candidate is less stable than our preferred stability,
|
||||
// and current package is more stable than candidate, skip it
|
||||
if ($minPriority < $candidatePriority && $currentPriority < $candidatePriority) {
|
||||
continue;
|
||||
}
|
||||
// candidate is more stable than our preferred stability, and current package is less stable than preferred stability, then we select the candidate always
|
||||
|
||||
// candidate is less stable than our preferred stability,
|
||||
// and current package is less stable than candidate, select candidate
|
||||
if ($minPriority < $candidatePriority && $candidatePriority < $currentPriority) {
|
||||
$package = $candidate;
|
||||
continue;
|
||||
}
|
||||
|
||||
// candidate is more stable than our preferred stability,
|
||||
// and current package is less stable than preferred stability, select candidate
|
||||
if ($minPriority >= $candidatePriority && $minPriority < $currentPriority) {
|
||||
$package = $candidate;
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue