You are here

public function Check::skip in Security Review 8

Marks the check as skipped.

It still can be ran manually, but will remain skipped on the Run & Review page.

File

src/Check.php, line 384

Class

Check
Defines a security check.

Namespace

Drupal\security_review

Code

public function skip() {
  if (!$this
    ->isSkipped()) {

    // Store skip data.
    $this->config
      ->set('skipped', TRUE);
    $this->config
      ->set('skipped_by', $this
      ->currentUser()
      ->id());
    $this->config
      ->set('skipped_on', time());
    $this->config
      ->save();

    // Log.
    $context = [
      '@name' => $this
        ->getTitle(),
    ];
    $this
      ->securityReview()
      ->log($this, '@name check skipped', $context, RfcLogLevel::NOTICE);
  }
}