From 5d14602207781527ba20cddb440b5ea36315a0b3 Mon Sep 17 00:00:00 2001 From: David Badura Date: Tue, 28 Jun 2022 16:31:31 +0200 Subject: [PATCH] allow to pas upcaster in default named constructor --- src/Serializer/DefaultEventSerializer.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Serializer/DefaultEventSerializer.php b/src/Serializer/DefaultEventSerializer.php index c2d78fe0..1002c25a 100644 --- a/src/Serializer/DefaultEventSerializer.php +++ b/src/Serializer/DefaultEventSerializer.php @@ -63,12 +63,13 @@ public function deserialize(SerializedEvent $data, array $options = []): object /** * @param list $paths */ - public static function createFromPaths(array $paths): static + public static function createFromPaths(array $paths, ?Upcaster $upcaster = null): static { return new self( (new AttributeEventRegistryFactory())->create($paths), new MetadataEventHydrator(new AttributeEventMetadataFactory()), - new JsonEncoder() + new JsonEncoder(), + $upcaster ); } }