You are here

public function Checklist::runChecks in Security Review 8

Runs an array of checks.

Parameters

\Drupal\security_review\Check[] $checks: The array of Checks to run.

bool $cli: Whether to call runCli() instead of run().

Return value

\Drupal\security_review\CheckResult[] The array of CheckResults generated.

1 call to Checklist::runChecks()
Checklist::runChecklist in src/Checklist.php
Runs enabled checks and stores their results.

File

src/Checklist.php, line 160

Class

Checklist
Contains static functions for handling checks throughout every module.

Namespace

Drupal\security_review

Code

public function runChecks(array $checks, $cli = FALSE) {
  $results = [];
  foreach ($checks as $check) {
    if ($cli) {
      $result = $check
        ->runCli();
    }
    else {
      $result = $check
        ->run();
    }
    $this->securityReview
      ->logCheckResult($result);
    $results[] = $result;
  }
  return $results;
}