You are here

public function ProjectSecurityRequirement::getRequirement in Drupal 8

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

Gets the security coverage requirement, if any.

Return value

array Requirements array as specified by hook_requirements(), or an empty array if no requirements can be determined.

File

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

Class

ProjectSecurityRequirement
Class for generating a project's security requirement.

Namespace

Drupal\update

Code

public function getRequirement() {
  if (isset($this->securityCoverageInfo['security_coverage_end_version'])) {
    $requirement = $this
      ->getVersionEndRequirement();
  }
  elseif (isset($this->securityCoverageInfo['security_coverage_end_date'])) {
    $requirement = $this
      ->getDateEndRequirement();
  }
  else {
    return [];
  }
  $requirement['title'] = $this
    ->t('Drupal core security coverage');
  return $requirement;
}