2424use ServiceBus \MessageSerializer \SymfonyNormalizer \Extensions \EmptyDataNormalizer ;
2525use ServiceBus \MessageSerializer \SymfonyNormalizer \Extensions \PropertyNameConverter ;
2626use ServiceBus \MessageSerializer \SymfonyNormalizer \Extensions \PropertyNormalizerWrapper ;
27- use Symfony \Component \PropertyInfo \Extractor \ReflectionExtractor ;
2827use Symfony \Component \Serializer as SymfonySerializer ;
2928use Symfony \Component \Serializer \Normalizer \DateTimeNormalizer ;
3029
@@ -73,7 +72,7 @@ public function encode(object $message): string
7372
7473 return $ this ->serializer ->serialize ($ data );
7574 }
76- catch (\Throwable $ throwable )
75+ catch (\Throwable $ throwable )
7776 {
7877 throw new EncodeMessageFailed ($ throwable ->getMessage (), (int ) $ throwable ->getCode (), $ throwable );
7978 }
@@ -96,7 +95,7 @@ public function decode(string $serializedMessage): object
9695
9796 return $ object ;
9897 }
99- catch (\Throwable $ throwable )
98+ catch (\Throwable $ throwable )
10099 {
101100 throw new DecodeMessageFailed ($ throwable ->getMessage (), (int ) $ throwable ->getCode (), $ throwable );
102101 }
@@ -117,7 +116,7 @@ public function denormalize(array $payload, string $class): object
117116
118117 return $ object ;
119118 }
120- catch (\Throwable $ throwable )
119+ catch (\Throwable $ throwable )
121120 {
122121 throw new DenormalizeFailed ($ throwable ->getMessage (), (int ) $ throwable ->getCode (), $ throwable );
123122 }
@@ -132,7 +131,7 @@ public function normalize(object $message): array
132131 {
133132 $ data = $ this ->normalizer ->normalize ($ message );
134133
135- if (true === \is_array ($ data ))
134+ if (true === \is_array ($ data ))
136135 {
137136 /** @psalm-var array<string, mixed> $data */
138137
@@ -149,7 +148,7 @@ public function normalize(object $message): array
149148 );
150149 // @codeCoverageIgnoreEnd
151150 }
152- catch (\Throwable $ throwable )
151+ catch (\Throwable $ throwable )
153152 {
154153 throw new NormalizationFailed ($ throwable ->getMessage (), (int ) $ throwable ->getCode (), $ throwable );
155154 }
@@ -163,11 +162,10 @@ public function normalize(object $message): array
163162 private static function validateUnserializedData (array $ data ): void
164163 {
165164 /** Let's check if there are mandatory fields */
166- if (
165+ if (
167166 false === isset ($ data ['namespace ' ]) ||
168167 false === isset ($ data ['message ' ])
169- )
170- {
168+ ) {
171169 throw new \UnexpectedValueException (
172170 'The serialized data must contains a "namespace" field (indicates the message class) and "message" (indicates the message parameters) '
173171 );
@@ -178,7 +176,7 @@ private static function validateUnserializedData(array $data): void
178176 *
179177 * @psalm-suppress DocblockTypeContradiction
180178 */
181- if ('' === $ data ['namespace ' ] || false === \class_exists ((string ) $ data ['namespace ' ]))
179+ if ('' === $ data ['namespace ' ] || false === \class_exists ((string ) $ data ['namespace ' ]))
182180 {
183181 throw new \UnexpectedValueException (
184182 \sprintf ('Class "%s" not found ' , $ data ['namespace ' ])
0 commit comments