146e12c016944d841f7c88275fae217778b8d5b1
[yaffs-website] / web / modules / contrib / security_review / src / CheckSettingsInterface.php
1 <?php
2
3 namespace Drupal\security_review;
4
5 /**
6  * Interface for check-specific settings and forms for altering them.
7  */
8 interface CheckSettingsInterface {
9
10   /**
11    * Gets a check-specific setting value identified by $key.
12    *
13    * @param string $key
14    *   The key.
15    * @param mixed $default_value
16    *   Default value to return in case $key does not exist.
17    *
18    * @return mixed
19    *   The value of the stored setting.
20    */
21   public function get($key, $default_value);
22
23   /**
24    * Sets a check-specific setting value identified by $key.
25    *
26    * @param string $key
27    *   The key.
28    * @param mixed $value
29    *   The new value.
30    *
31    * @return CheckSettingsInterface
32    *   Returns itself.
33    */
34   public function set($key, $value);
35
36   /**
37    * Form constructor.
38    *
39    * @return array
40    *   The form structure.
41    */
42   public function buildForm();
43
44   /**
45    * Form validation handler.
46    *
47    * @param array $form
48    *   An associative array containing the structure of the form.
49    * @param array $values
50    *   The current values of the form.
51    */
52   public function validateForm(array &$form, array $values);
53
54   /**
55    * Form submission handler.
56    *
57    * @param array $form
58    *   An associative array containing the structure of the form.
59    * @param array $values
60    *   The current values of the form.
61    */
62   public function submitForm(array &$form, array $values);
63
64 }