You are here

public function CheckSettings::get in Security Review 8

Gets a check-specific setting value identified by $key.

Parameters

string $key: The key.

mixed $default_value: Default value to return in case $key does not exist.

Return value

mixed The value of the stored setting.

Overrides CheckSettingsInterface::get

1 call to CheckSettings::get()
TrustedHostSettings::buildForm in src/CheckSettings/TrustedHostSettings.php
Form constructor.

File

src/CheckSettings.php, line 42

Class

CheckSettings
Defines the default implementation of CheckSettingsInterface.

Namespace

Drupal\security_review

Code

public function get($key, $default_value = NULL) {
  $value = $this->config
    ->get('settings.' . $key);
  if ($value == NULL) {
    return $default_value;
  }
  return $value;
}