Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Versions.php

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\SelfUpdate

Code

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 . ')');
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal