#107040Streamline array vs object handling in settings type values
Description
A custom settings type that implements a rich value (e.g. consisting of sub-objects or arrays) has to handle the value as an array or as an object depending on which context calls transformValue():
public function transformValue(mixed $value, SettingDefinition $definition): array
{
return array_map(static fn (array|object $entry) => is_object($entry) ? (array)$entry : $entry, $value);
}
We should ideally deliver yaml objects as php stdClass objects and arrays as arrays, always, but that might be breaking for existing anonymous (pre v13) settings, that are used to use array, even if objects were configured in yaml.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[TASK] Streamline array vs object handling in settings type values Resolves: #107040 Releases: main