fix(taskprocessing): input validation was dropping some optional inputs

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
Julien Veyssier 2024-06-23 22:47:32 +02:00
parent 7525eddb96
commit 7e1dd0b25e
No known key found for this signature in database
GPG key ID: 4141FEE162030638

View file

@ -489,7 +489,7 @@ class Manager implements IManager {
* @psalm-template T
*/
private function removeSuperfluousArrayKeys(array $array, ...$specs): array {
$keys = array_unique(array_reduce($specs, fn ($carry, $spec) => $carry + array_keys($spec), []));
$keys = array_unique(array_reduce($specs, fn ($carry, $spec) => array_merge($carry, array_keys($spec)), []));
$values = array_map(fn (string $key) => $array[$key], $keys);
return array_combine($keys, $values);
}