You are here

private function ProjectSecurityRequirement::getVersionEndCoverageMessage in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/update/src/ProjectSecurityRequirement.php \Drupal\update\ProjectSecurityRequirement::getVersionEndCoverageMessage()
  2. 9 core/modules/update/src/ProjectSecurityRequirement.php \Drupal\update\ProjectSecurityRequirement::getVersionEndCoverageMessage()

Gets the message for additional minor version security coverage.

Return value

array[] A render array containing security coverage message.

See also

\Drupal\update\ProjectSecurityData::getCoverageInfo()

File

core/modules/update/src/ProjectSecurityRequirement.php, line 162

Class

ProjectSecurityRequirement
Class for generating a project's security requirement.

Namespace

Drupal\update

Code

private function getVersionEndCoverageMessage() {
  if ($this->securityCoverageInfo['additional_minors_coverage'] > 0) {

    // If the installed minor version will receive security coverage until
    // newer minor versions are released, inform the user.
    if ($this->securityCoverageInfo['additional_minors_coverage'] === 1) {

      // If the installed minor version will only receive security coverage
      // for 1 newer minor core version, encourage the site owner to update
      // soon.
      $message['coverage_message'] = [
        '#markup' => $this
          ->t('<a href=":update_status_report">Update to @next_minor or higher</a> soon to continue receiving security updates.', [
          ':update_status_report' => Url::fromRoute('update.status')
            ->toString(),
          '@next_minor' => $this->nextMajorMinorVersion,
        ]),
        '#suffix' => ' ',
      ];
    }
  }
  else {

    // Because the current minor version no longer has security coverage,
    // advise the site owner to update.
    $message['coverage_message'] = [
      '#markup' => $this
        ->getVersionNoSecurityCoverageMessage(),
      '#suffix' => ' ',
    ];
  }
  $message['release_cycle_link'] = [
    '#markup' => $this
      ->getReleaseCycleLink(),
  ];
  return $message;
}