You are here

public function InstallableLibrary::getNewerVersions in Markdown 8.2

Retrieves the newer versions of the library.

Note: this will likely make an HTTP request.

Parameters

string $minimumStability: Optional. The minimum stability to determine which latest version to retrieve.

Return value

string[] The newer versions.

2 calls to InstallableLibrary::getNewerVersions()
InstallableLibrary::getLatestVersion in src/Annotation/InstallableLibrary.php
Retrieves the latest version based on available versions.
InstallableLibrary::getStatus in src/Annotation/InstallableLibrary.php
Retrieves the current status of the library.

File

src/Annotation/InstallableLibrary.php, line 173

Class

InstallableLibrary

Namespace

Drupal\markdown\Annotation

Code

public function getNewerVersions($minimumStability = 'stable') {
  $version = ($this->version ?: '*') . "@{$minimumStability}";
  if (!isset($this->newerVersions[$version])) {
    $availableVersions = $this
      ->getAvailableVersions();
    $this->newerVersions[$version] = Semver::sort($this->version ? Semver::satisfiedBy($availableVersions, ">{$version}") : $availableVersions);
  }
  return $this->newerVersions[$version];
}