protected function validateValue($key,
$value) { // Minimal validation. Should not try to serialize resources or non-arrays.
if (is_array($value)) { foreach ($value as $nested_value_key =>
$nested_value) { $this->
validateValue($key . '.' .
$nested_value_key,
$nested_value);
} } elseif ($value !== NULL && !
is_scalar($value)) { throw new UnsupportedDataTypeConfigException("Invalid data type for config element {
$this->
getName()}:
$key"
);
} } /**
* Casts the value to correct data type using the configuration schema.
*
* @param string|null $key
* A string that maps to a key within the configuration data. If NULL the
* top level mapping will be processed.
* @param mixed $value
* Value to associate with the key.
*
* @return mixed
* The value cast to the type indicated in the schema.
*
* @throws \Drupal\Core\Config\UnsupportedDataTypeConfigException
* If the value is unsupported in configuration.
*/