You are here

private function ProjectSecurityData::getSecurityCoverageUntilVersion in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/update/src/ProjectSecurityData.php \Drupal\update\ProjectSecurityData::getSecurityCoverageUntilVersion()

Gets the release the current minor will receive security coverage until.

For the sake of example, assume that the currently installed version of Drupal is 8.7.11 and that static::CORE_MINORS_WITH_SECURITY_COVERAGE is 2. When Drupal 8.9.0 is released, the supported minor versions will be 8.8 and 8.9. At that point, Drupal 8.7 will no longer have security coverage. Therefore, this function would return "8.9.0".

@todo In https://www.drupal.org/node/2998285 determine how we will know what the final minor release of a particular major version will be. This method should not return a version beyond that minor.

Return value

string|null The version the existing version will receive security coverage until or NULL if this cannot be determined.

1 call to ProjectSecurityData::getSecurityCoverageUntilVersion()
ProjectSecurityData::getCoverageInfo in core/modules/update/src/ProjectSecurityData.php
Gets the security coverage information for a project.

File

core/modules/update/src/ProjectSecurityData.php, line 164

Class

ProjectSecurityData
Calculates a project's security coverage information.

Namespace

Drupal\update

Code

private function getSecurityCoverageUntilVersion() {
  $existing_release_version = ExtensionVersion::createFromVersionString($this->existingVersion);
  if (!empty($existing_release_version
    ->getVersionExtra())) {

    // Only full releases receive security coverage.
    return NULL;
  }
  return $existing_release_version
    ->getMajorVersion() . '.' . ($this
    ->getSemanticMinorVersion($this->existingVersion) + static::CORE_MINORS_WITH_SECURITY_COVERAGE) . '.0';
}