3 namespace Drupal\security_review;
5 use Drupal\Core\Config\Config;
8 * Defines the default implementation of CheckSettingsInterface.
10 class CheckSettings implements CheckSettingsInterface {
15 * @var \Drupal\security_review\Check
20 * The configuration storage of the parent Check.
22 * @var \Drupal\Core\Config\Config $config
27 * Creates a CheckSettings instance.
29 * @param \Drupal\security_review\Check $check
31 * @param \Drupal\Core\Config\Config $config
32 * The parent Check's configuration.
34 public function __construct(Check $check, Config &$config) {
35 $this->check = $check;
36 $this->config = $config;
42 public function get($key, $default_value = NULL) {
43 $value = $this->config->get('settings.' . $key);
46 return $default_value;
54 public function set($key, $value) {
55 $this->config->set('settings.' . $key, $value);
56 $this->config->save();
63 public function buildForm() {
70 public function validateForm(array &$form, array $values) {
71 // Validation is optional.
77 public function submitForm(array &$form, array $values) {