5 * Contains \Drupal\security_review\CheckSettings.
8 namespace Drupal\security_review;
10 use Drupal\Core\Config\Config;
13 * Defines the default implementation of CheckSettingsInterface.
15 class CheckSettings implements CheckSettingsInterface {
20 * @var \Drupal\security_review\Check
25 * The configuration storage of the parent Check.
27 * @var \Drupal\Core\Config\Config $config
32 * Creates a CheckSettings instance.
34 * @param \Drupal\security_review\Check $check
36 * @param \Drupal\Core\Config\Config $config
37 * The parent Check's configuration.
39 public function __construct(Check $check, Config &$config) {
40 $this->check = $check;
41 $this->config = $config;
47 public function get($key, $default_value = NULL) {
48 $value = $this->config->get('settings.' . $key);
51 return $default_value;
59 public function set($key, $value) {
60 $this->config->set('settings.' . $key, $value);
61 $this->config->save();
68 public function buildForm() {
75 public function validateForm(array &$form, array $values) {
76 // Validation is optional.
82 public function submitForm(array &$form, array $values) {