You are here

public function ErrorReporting::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/ErrorReporting.php, line 64

Class

ErrorReporting
Defines a security check that checks the error reporting setting.

Namespace

Drupal\security_review\Checks

Code

public function evaluate(CheckResult $result) {
  if ($result
    ->result() == CheckResult::SUCCESS) {
    return [];
  }
  $paragraphs = [];
  $paragraphs[] = $this
    ->t('You have error reporting set to both the screen and the log.');
  $paragraphs[] = Link::createFromRoute($this
    ->t('Alter error reporting settings.'), 'system.logging_settings');
  return [
    '#theme' => 'check_evaluation',
    '#paragraphs' => $paragraphs,
    '#items' => [],
  ];
}