public function applyDefaultSettings(&$fieldSettings)
{
if ($fieldSettings !== null && !is_array($fieldSettings)) {
throw new InvalidArgumentType('$fieldSettings', 'array|null', $fieldSettings);
}
foreach ($this->getSettingsSchema() as $settingName => $settingConfiguration) {
// Checking that a default entry exists in the settingsSchema but that no value has been provided
if (!array_key_exists($settingName, (array) $fieldSettings) && array_key_exists('default', $settingConfiguration)) {
$fieldSettings[$settingName] = $settingConfiguration['default'];
}
}
}