// the data if it doesn't already exist.
if (!
isset($config_data['langcode'
])) { $config_data['langcode'
] = 'en';
} $this->configName =
$config_name;
if (!
$typed_config->
hasConfigSchema($config_name)) { return FALSE;
} $this->schema =
$typed_config->
createFromNameAndData($config_name,
$config_data);
$errors =
[];
foreach ($config_data as $key =>
$value) { $errors[] =
$this->
checkValue($key,
$value);
} $errors =
array_merge(...
$errors);
if (empty($errors)) { return TRUE;
} return $errors;
} /**
* Helper method to check data type.
*
* @param string $key
* A string of configuration key.
* @param mixed $value
* Value of given key.
*
* @return array
* List of errors found while checking with the corresponding schema.
*/