Skip to content

Commit

Permalink
Do not try to pass parameters that are not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
simensen committed Jun 6, 2023
1 parent 2a19164 commit 2372395
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Serialization/EdgeAwareReflectionSerializing.php
Expand Up @@ -94,7 +94,9 @@ public static function fromPayload(array $payload): static
}
}

$args[$constructorKey] = $payload[$key];
if (array_key_exists($key, $payload)) {
$args[$constructorKey] = $payload[$key];
}
}

return $class->newInstance(...$args);
Expand Down

0 comments on commit 2372395

Please sign in to comment.