You are here

public function DiagnosticCheckBase::getRequirementsArray in Purge 8.3

Generates a individual Drupal-like requirements array.

Return value

array An associative array with the following elements:

  • title: The name of this check.
  • value: The current value (e.g., version, time, level, etc), will not be set if not applicable.
  • description: The description of the check.
  • severity_status: severity string: 'info', 'ok', 'warning' or 'error'.
  • severity: The check's result/severity level, one of:

Overrides DiagnosticCheckInterface::getRequirementsArray

File

src/Plugin/Purge/DiagnosticCheck/DiagnosticCheckBase.php, line 152

Class

DiagnosticCheckBase
Describes a diagnostic check that tests a specific purging requirement.

Namespace

Drupal\purge\Plugin\Purge\DiagnosticCheck

Code

public function getRequirementsArray() {
  $this
    ->runCheck();
  return [
    'title' => (string) $this
      ->getTitle(),
    'value' => (string) $this
      ->getValue(),
    'description' => (string) $this
      ->getRecommendation(),
    'severity_status' => strtolower($this
      ->getSeverityString()),
    'severity' => $this
      ->getRequirementsSeverity(),
  ];
}