You are here

public function Check::getMachineNamespace in Security Review 8

Returns the namespace of the check.

Usually it's the same as the module's name.

Naming rules (if overridden):

  • All characters should be lowerspace.
  • Use characters only from the english alphabet.
  • Don't use spaces (use "_" instead).

Return value

string Machine namespace of the check.

1 call to Check::getMachineNamespace()
Check::id in src/Check.php
Returns the identifier constructed using the namespace and title values.

File

src/Check.php, line 85

Class

Check
Defines a security check.

Namespace

Drupal\security_review

Code

public function getMachineNamespace() {
  $namespace = strtolower($this
    ->getNamespace());
  $namespace = preg_replace("/[^a-z0-9 ]/", '', $namespace);
  $namespace = str_replace(' ', '_', $namespace);
  return $namespace;
}