More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / modules / contrib / security_review / security_review.api.php
1 <?php
2
3 /**
4  * @file
5  * Defines the API for Security Review.
6  */
7
8 /*
9 use Drupal\mymodule\MyCheck;
10 use Drupal\mymodule\MyOtherCheck;
11  */
12 use Drupal\security_review\Check;
13
14 /**
15  * Returns the array of security checks the module defines.
16  *
17  * The checks must extend \Drupal\security_review\Check.
18  *
19  * @return array
20  *   An array of security checks.
21  */
22 function hook_security_review_checks() {
23   // Return instances of the defined Checks.
24   return [
25     /*
26     new MyCheck(),
27     new MyOtherCheck(),
28     */
29   ];
30 }
31
32 /**
33  * Provides logging capabilities.
34  *
35  * @param \Drupal\security_review\Check $check
36  *   The Check the event is related to.
37  * @param string $message
38  *   The message.
39  * @param array $context
40  *   The context of the message.
41  * @param int $level
42  *   Severity (RfcLogLevel).
43  */
44 function hook_security_review_log(Check $check, $message, array $context, $level) {
45   if ($check->getNamespace() == "My Module") {
46     // Do something with the information.
47   }
48 }