public getLatestRelease ( string $package, string $stability = 'stable' ) : string | boolean | ||
$package | string | The name of the package. |
$stability | string | The stability of the release. Must be one of "stable", "beta", "alpha", or "devel". The default is "stable" If you explicitely set the $stability parameter to NULL the method will return the highest release version independent of the stability. |
return | string | boolean | The latest version for this stability or false if no version with this stability level exists. |
public function getLatestRelease($package, $stability = 'stable')
{
if ($stability === null) {
return $this->_rest->fetchLatestRelease($package);
} else {
$result = $this->_rest->fetchLatestPackageReleases($package);
return isset($result[$stability]) ? $result[$stability] : false;
}
}
/** * Return the version of the component. * * @return string The component version. */ public function getVersion() { if (!isset($this->_version)) { $this->_version = $this->_remote->getLatestRelease($this->_name, $this->_stability); } return $this->_version; }