Skip to content

Serialize Enum variants with the variant name#1860

Merged
cleptric merged 1 commit intogetsentry:masterfrom
blackwolf12333:master
Jun 12, 2025
Merged

Serialize Enum variants with the variant name#1860
cleptric merged 1 commit intogetsentry:masterfrom
blackwolf12333:master

Conversation

@blackwolf12333
Copy link
Copy Markdown
Contributor

With enum types it's almost always useful to know exactly which variant is being logged. But the current serializers don't differentiate between enums and objects.

This changes the serializers to add the variant name of the enum that is being serialized.

@stayallive
Copy link
Copy Markdown
Collaborator

This needs changes to only run the tests in PHP 8.1+ but otherwise, great!

@blackwolf12333
Copy link
Copy Markdown
Contributor Author

Yeah already working on it, didn't realize 7.* was still supported.

Comment thread phpunit.xml.dist Outdated
@blackwolf12333 blackwolf12333 force-pushed the master branch 4 times, most recently from 47ec155 to 9fdeca8 Compare June 12, 2025 12:08
With enum types it's almost always useful to know exactly which variant is being
logged. But the current serializers don't differentiate between enums and objects.

This changes the serializers to add the variant name of the enum that is being
serialized.
Copy link
Copy Markdown
Member

@cleptric cleptric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cleptric cleptric merged commit 6a1adc2 into getsentry:master Jun 12, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants