You are here

public function Checklist::getCheckById in Security Review 8

Finds a Check by its id.

Parameters

string $id: The machine namespace of the requested check.

Return value

null|\Drupal\security_review\Check The Check or null if it doesn't exist.

File

src/Checklist.php, line 221

Class

Checklist
Contains static functions for handling checks throughout every module.

Namespace

Drupal\security_review

Code

public function getCheckById($id) {
  foreach (static::getChecks() as $check) {
    if ($check
      ->id() == $id) {
      return $check;
    }
  }
  return NULL;
}