public function getCurrentRemoteVersion(Updater $updater)
{
$versions = array_keys($this->getAvailableVersions());
if (!$this->allowMajor) {
$versions = $this->filterByLocalMajorVersion($versions);
}
if (!$this->ignorePhpReq) {
$versions = $this->filterByPhpVersion($versions);
}
$versionParser = new VersionParser($versions);
$mostRecent = $versionParser->getMostRecentStable();
// Look for unstable updates if explicitly allowed, or if the local
// version is already unstable and there is no new stable version.
if ($this->allowUnstable || $versionParser->isUnstable($this->localVersion) && version_compare($mostRecent, $this->localVersion, '<')) {
$mostRecent = $versionParser->getMostRecentAll();
}
return version_compare($mostRecent, $this->localVersion, '>') ? $mostRecent : false;
}