function ProjectSecurityRequirement::getVersionEndRequirement

Same name in other branches
  1. 9 core/modules/update/src/ProjectSecurityRequirement.php \Drupal\update\ProjectSecurityRequirement::getVersionEndRequirement()
  2. 8.9.x core/modules/update/src/ProjectSecurityRequirement.php \Drupal\update\ProjectSecurityRequirement::getVersionEndRequirement()
  3. 10 core/modules/update/src/ProjectSecurityRequirement.php \Drupal\update\ProjectSecurityRequirement::getVersionEndRequirement()

Gets the requirements based on security coverage until a specific version.

Return value

array Requirements array as specified by hook_requirements().

1 call to ProjectSecurityRequirement::getVersionEndRequirement()
ProjectSecurityRequirement::getRequirement in core/modules/update/src/ProjectSecurityRequirement.php
Gets the security coverage requirement, if any.

File

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

Class

ProjectSecurityRequirement
Class for generating a project's security requirement.

Namespace

Drupal\update

Code

private function getVersionEndRequirement() {
    $requirement = [];
    if ($security_coverage_message = $this->getVersionEndCoverageMessage()) {
        $requirement['description'] = $security_coverage_message;
        if ($this->securityCoverageInfo['additional_minors_coverage'] > 0) {
            $requirement['value'] = $this->t('Covered until @end_version', [
                '@end_version' => $this->securityCoverageInfo['security_coverage_end_version'],
            ]);
            $requirement['severity'] = $this->securityCoverageInfo['additional_minors_coverage'] > 1 ? REQUIREMENT_INFO : REQUIREMENT_WARNING;
        }
        else {
            $requirement['value'] = $this->t('Coverage has ended');
            $requirement['severity'] = REQUIREMENT_ERROR;
        }
    }
    return $requirement;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.