You are here

public function Rest::process in Production check & Production monitor 8

Processes a single prod check plugin

Overrides Internal::process

File

modules/prod_check_rest/src/Plugin/ProdCheckProcessor/Rest.php, line 21

Class

Rest
Release notes check

Namespace

Drupal\prod_check_rest\Plugin\ProdCheckProcessor

Code

public function process(ProdCheckInterface $check) {
  $check
    ->setProcessor($this);
  $status = $check
    ->state();
  $requirement = [
    'status' => $status,
    'severity' => $status ? $this
      ->ok() : $check
      ->severity(),
    'title' => (string) $check
      ->title(),
    'category' => (string) $check
      ->category(),
  ];
  if ($status) {
    $requirement += $check
      ->successMessages();
  }
  else {
    $requirement += $check
      ->failMessages();
  }
  return $requirement;
}