Skip to content

Commit

Permalink
Fix bug that prevented deep-nested config fields from being validated.
Browse files Browse the repository at this point in the history
  • Loading branch information
ash-jc-allen committed Apr 26, 2024
1 parent 117b8cd commit f0316f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Services/ValidationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ private function fetchCurrentConfigValues(string $key, Rule $rule): void
// If the config value is nested (e.g. mail.from.address) then we add
// it differently to standard non-nested fields.
if (is_array($hydrated[$field])) {
$this->configValues[$key][$field] += $hydrated[$field];
$this->configValues[$key][array_key_first($hydrated)] = array_merge_recursive(
$this->configValues[$key][$field],
$hydrated[$field],
);
} else {
$this->configValues[$key][array_key_first($hydrated)] = $hydrated[array_key_first($hydrated)];
}
Expand Down

0 comments on commit f0316f8

Please sign in to comment.