You are here

public function QueryErrors::evaluate in Security Review 8

Returns the evaluation page of a result.

Usually this is a list of the findings and an explanation.

Parameters

\Drupal\security_review\CheckResult $result: The check result to evaluate.

Return value

array The render array of the evaluation page.

Overrides Check::evaluate

File

src/Checks/QueryErrors.php, line 122

Class

QueryErrors
Checks for abundant query errors.

Namespace

Drupal\security_review\Checks

Code

public function evaluate(CheckResult $result) {
  $findings = $result
    ->findings();
  if (empty($findings)) {
    return [];
  }
  $paragraphs = [];
  $paragraphs[] = $this
    ->t('The following IPs were observed with an abundance of query errors.');
  return [
    '#theme' => 'check_evaluation',
    '#paragraphs' => $paragraphs,
    '#items' => $result
      ->findings(),
  ];
}