You are here

public function QueryErrors::evaluatePlain in Security Review 8

Evaluates a CheckResult and returns a plaintext output.

Parameters

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

Return value

string The evaluation string.

Overrides Check::evaluatePlain

File

src/Checks/QueryErrors.php, line 141

Class

QueryErrors
Checks for abundant query errors.

Namespace

Drupal\security_review\Checks

Code

public function evaluatePlain(CheckResult $result) {
  $findings = $result
    ->findings();
  if (empty($findings)) {
    return '';
  }
  $output = $this
    ->t('Suspicious IP addresses:') . ":\n";
  foreach ($findings as $ip) {
    $output .= "\t" . $ip . "\n";
  }
  return $output;
}