$version = $this->getNewestPackageVersion($package);
}
+ if ($version === null) {
+ throw new SystemException("Cannot find the package '" . $package . "'");
+ }
+
// get versions
$conditions = new PreparedStatementConditionBuilder();
$conditions->add('pu.package = ?', [$package]);
$versions = $statement->fetchAll(\PDO::FETCH_ASSOC);
if (empty($versions)) {
- throw new SystemException("Cannot find package '" . $package . "' in version '" . $version . "'");
+ throw new SystemException("Cannot find the package '" . $package . "' in version '" . $version . "'");
}
return $versions;
/**
* Returns the newest available version of a package.
*/
- public function getNewestPackageVersion(string $package): string
+ public function getNewestPackageVersion(string $package): ?string
{
// get all versions
$versions = [];