You are here

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

Class

TemporaryFiles
Check for sensitive temporary files like settings.php~.

Namespace

Drupal\security_review\Checks

Code

public function evaluate(CheckResult $result) {
  $findings = $result
    ->findings();
  if (empty($findings)) {
    return [];
  }
  $paragraphs = [];
  $paragraphs[] = $this
    ->t("The following are extraneous files in your Drupal installation that can probably be removed. You should confirm you have saved any of your work in the original files prior to removing these.");
  return [
    '#theme' => 'check_evaluation',
    '#paragraphs' => $paragraphs,
    '#items' => $findings,
  ];
}