@@ -76,7 +76,7 @@ public function encode(object $message): string
76
76
77
77
return $ this ->serializer ->serialize ($ data );
78
78
}
79
- catch (\Throwable $ throwable )
79
+ catch (\Throwable $ throwable )
80
80
{
81
81
throw new EncodeMessageFailed ($ throwable ->getMessage (), (int ) $ throwable ->getCode (), $ throwable );
82
82
}
@@ -99,7 +99,7 @@ public function decode(string $serializedMessage): object
99
99
100
100
return $ object ;
101
101
}
102
- catch (\Throwable $ throwable )
102
+ catch (\Throwable $ throwable )
103
103
{
104
104
throw new DecodeMessageFailed ($ throwable ->getMessage (), (int ) $ throwable ->getCode (), $ throwable );
105
105
}
@@ -120,7 +120,7 @@ public function denormalize(array $payload, string $class): object
120
120
121
121
return $ object ;
122
122
}
123
- catch (\Throwable $ throwable )
123
+ catch (\Throwable $ throwable )
124
124
{
125
125
throw new DenormalizeFailed ($ throwable ->getMessage (), (int ) $ throwable ->getCode (), $ throwable );
126
126
}
@@ -135,7 +135,7 @@ public function normalize(object $message): array
135
135
{
136
136
$ data = $ this ->normalizer ->normalize ($ message );
137
137
138
- if (\is_array ($ data ) === true )
138
+ if (\is_array ($ data ) === true )
139
139
{
140
140
/** @psalm-var array<string, mixed> $data */
141
141
@@ -152,7 +152,7 @@ public function normalize(object $message): array
152
152
);
153
153
// @codeCoverageIgnoreEnd
154
154
}
155
- catch (\Throwable $ throwable )
155
+ catch (\Throwable $ throwable )
156
156
{
157
157
throw new NormalizationFailed ($ throwable ->getMessage (), (int ) $ throwable ->getCode (), $ throwable );
158
158
}
@@ -166,11 +166,10 @@ public function normalize(object $message): array
166
166
private static function validateUnserializedData (array $ data ): void
167
167
{
168
168
/** Let's check if there are mandatory fields */
169
- if (
169
+ if (
170
170
isset ($ data ['namespace ' ]) === false ||
171
171
isset ($ data ['message ' ]) === false
172
- )
173
- {
172
+ ) {
174
173
throw new \UnexpectedValueException (
175
174
'The serialized data must contains a "namespace" field (indicates the message class) and "message" (indicates the message parameters) '
176
175
);
@@ -181,7 +180,7 @@ private static function validateUnserializedData(array $data): void
181
180
*
182
181
* @psalm-suppress DocblockTypeContradiction
183
182
*/
184
- if ($ data ['namespace ' ] === '' || \class_exists ((string ) $ data ['namespace ' ]) === false )
183
+ if ($ data ['namespace ' ] === '' || \class_exists ((string ) $ data ['namespace ' ]) === false )
185
184
{
186
185
throw new \UnexpectedValueException (
187
186
\sprintf ('Class "%s" not found ' , $ data ['namespace ' ])
0 commit comments