5 * Defines the API for Security Review.
9 use Drupal\mymodule\MyCheck;
10 use Drupal\mymodule\MyOtherCheck;
12 use Drupal\security_review\Check;
15 * Returns the array of security checks the module defines.
17 * The checks must extend \Drupal\security_review\Check.
20 * An array of security checks.
22 function hook_security_review_checks() {
23 // Return instances of the defined Checks.
33 * Provides logging capabilities.
35 * @param \Drupal\security_review\Check $check
36 * The Check the event is related to.
37 * @param string $message
39 * @param array $context
40 * The context of the message.
42 * Severity (RfcLogLevel).
44 function hook_security_review_log(Check $check, $message, array $context, $level) {
45 if ($check->getNamespace() == "My Module") {
46 // Do something with the information.