You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25
Original file line number
Diff line number
Diff line change
@@ -201,6 +201,31 @@ final class SentryCustomizationCompilerPass implements CompilerPassInterface
201
201
}
202
202
```
203
203
204
+
#### Custom serializers
205
+
206
+
The option class_serializers can be used to send customized objects serialization.
207
+
```yml
208
+
sentry:
209
+
options:
210
+
class_serializers:
211
+
YourValueObject: '@ValueObjectSerializer'
212
+
```
213
+
214
+
Several serializers can be added and the serializable check is done using **instanceof**. The serializer must implements the `__invoke` method returning an **array** with the information to send to sentry (class name is always sent).
215
+
216
+
Serializer example:
217
+
```php
218
+
final class ValueObjectSerializer
219
+
{
220
+
public function __invoke(YourValueObject $vo): array
0 commit comments