function Versions::getLatest
Return value
array{path: string, version: string, min-php: int, eol?: true}
File
-
vendor/
composer/ composer/ src/ Composer/ SelfUpdate/ Versions.php, line 87
Class
- Versions
- @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\SelfUpdateCode
public function getLatest(?string $channel = null) : array {
$versions = $this->getVersionsData();
foreach ($versions[$channel ?: $this->getChannel()] as $version) {
if ($version['min-php'] <= \PHP_VERSION_ID) {
return $version;
}
}
throw new \UnexpectedValueException('There is no version of Composer available for your PHP version (' . PHP_VERSION . ')');
}