throw new \InvalidArgumentException("Could not find package $name" . ($packageVersion ? " with version $packageVersion." : " with stability $stability."));
// candidate is less stable than our preferred stability, and we have a package that is more stable than it, so we 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
if ($minPriority >= $candidatePriority && $minPriority < $currentPriority) {
$package = $candidate;
continue;
}
// select highest version of the two
if (version_compare($package->getVersion(), $candidate->getVersion(), '<')) {