]);
}
- $this->appFetcher->setVersion($newVersion, 'future-apps.json');
+ $this->appFetcher->setVersion($newVersion, 'future-apps.json', false);
// Apps available on the app store for that version
$availableApps = array_map(function(array $app) {
/** @var CompareVersion */
private $compareVersion;
+ /** @var bool */
+ private $ignoreMaxVersion;
+
/**
* @param Factory $appDataFactory
* @param IClientService $clientService
$this->fileName = 'apps.json';
$this->setEndpoint();
$this->compareVersion = $compareVersion;
+ $this->ignoreMaxVersion = true;
}
/**
$version = $versionParser->getVersion($release['rawPlatformVersionSpec']);
$ncVersion = $this->getVersion();
$min = $version->getMinimumVersion();
+ $max = $version->getMaximumVersion();
$minFulfilled = $this->compareVersion->isCompatible($ncVersion, $min, '>=');
- if ($minFulfilled) {
+ $maxFulfilled = $max !== '' &&
+ $this->compareVersion->isCompatible($ncVersion, $max, '<=');
+ if ($minFulfilled && ($this->ignoreMaxVersion || $maxFulfilled)) {
$releases[] = $release;
}
} catch (\InvalidArgumentException $e) {
/**
* @param string $version
* @param string $fileName
+ * @param bool $ignoreMaxVersion
*/
- public function setVersion(string $version, string $fileName = 'apps.json') {
+ public function setVersion(string $version, string $fileName = 'apps.json', bool $ignoreMaxVersion = true) {
parent::setVersion($version);
$this->fileName = $fileName;
+ $this->ignoreMaxVersion = $ignoreMaxVersion;
$this->setEndpoint();
}
}