You are here

private function SecurityReviewCommands::getCheck in Security Review 8

Helper function for parsing input check name strings.

Parameters

string $check_name: The check to get.

Return value

\Drupal\security_review\Check|null The found Check.

1 call to SecurityReviewCommands::getCheck()
SecurityReviewCommands::securityReview in src/Commands/SecurityReviewCommands.php
Run the Security Review checklist.

File

src/Commands/SecurityReviewCommands.php, line 256

Class

SecurityReviewCommands
Class SecurityReviewCommands.

Namespace

Drupal\security_review\Commands

Code

private function getCheck($check_name) {

  // Default namespace is Security Review.
  $namespace = 'security_review';
  $title = $check_name;

  // Set namespace and title if explicitly defined.
  if (strpos($check_name, ':') !== FALSE) {
    list($namespace, $title) = explode(':', $check_name);
  }

  // Return the found check if any.
  return $this->checklistService
    ->getCheck($namespace, $title);
}