Fixing failing version test

Wrapping version in Array() to comply with SemVer new method signature. This should fix #487.
This commit is contained in:
jelko 2018-11-14 01:14:53 +01:00 committed by GitHub
parent 7beadd05b0
commit 05b62f9258
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,16 +45,16 @@ class Airtime_View_Helper_VersionNotify extends Zend_View_Helper_Abstract {
$isPreRelease = $isGitRelease || array_key_exists(4, $currentParts); $isPreRelease = $isGitRelease || array_key_exists(4, $currentParts);
// we are always interested in a major when we pre-release, hence the isPreRelease part // we are always interested in a major when we pre-release, hence the isPreRelease part
$majorCandidates = SemVer::satisfiedBy($latest, sprintf('>=%1$s-stable', $currentParts[0] + ($isPreRelease ? 0 : 1))); $majorCandidates = SemVer::satisfiedBy(array($latest), sprintf('>=%1$s-stable', $currentParts[0] + ($isPreRelease ? 0 : 1)));
$minorCandidates = SemVer::satisfiedBy($latest, sprintf('~%1$s.%2$s', $currentParts[0], $currentParts[1] + 1)); $minorCandidates = SemVer::satisfiedBy(array($latest), sprintf('~%1$s.%2$s', $currentParts[0], $currentParts[1] + 1));
$patchCandidates = SemVer::satisfiedBy($latest, sprintf('>=%1$s.%2$s.%3$s <%1$s.%3$s', $currentParts[0], $currentParts[1], $currentParts[2] + 1)); $patchCandidates = SemVer::satisfiedBy(array($latest), sprintf('>=%1$s.%2$s.%3$s <%1$s.%3$s', $currentParts[0], $currentParts[1], $currentParts[2] + 1));
$hasMajor = !empty($majorCandidates); $hasMajor = !empty($majorCandidates);
$hasMinor = !empty($minorCandidates); $hasMinor = !empty($minorCandidates);
$hasPatch = !empty($patchCandidates); $hasPatch = !empty($patchCandidates);
$hasMultiMajor = count($majorCandidates) > 1; $hasMultiMajor = count($majorCandidates) > 1;
if ($isPreRelease) { if ($isPreRelease) {
$stableVersions = SemVer::satisfiedBy($latest, sprintf('>=%1$s.%2$s.%3$s-stable', $currentParts[0], $currentParts[1], $currentParts[2])); $stableVersions = SemVer::satisfiedBy(array($latest), sprintf('>=%1$s.%2$s.%3$s-stable', $currentParts[0], $currentParts[1], $currentParts[2]));
// git releases are never interested in a stable version :P // git releases are never interested in a stable version :P
$hasStable = !empty($stableVersions) && !$isGitRelease; $hasStable = !empty($stableVersions) && !$isGitRelease;
// no warning if no major release available, orange warning if you are on unreleased code // no warning if no major release available, orange warning if you are on unreleased code
@ -71,7 +71,7 @@ class Airtime_View_Helper_VersionNotify extends Zend_View_Helper_Abstract {
} else { } else {
$class = 'uptodate'; $class = 'uptodate';
} }
$latest = SemVer::rsort($latest); $latest = SemVer::rsort(array($latest));
$highestVersion = $latest[0]; $highestVersion = $latest[0];
$data = (object) array( $data = (object) array(