Skip to content

Conversation

@thePanz
Copy link
Contributor

@thePanz thePanz commented Dec 4, 2025

Added common normalizers

  • CamelCaseKeysTransformer
  • SnakeCaseKeysTransformer
  • CustomDateTimeTransformer

@thePanz thePanz force-pushed the introduce-common-normalizer-transformers branch 2 times, most recently from 4bbf9bd to 478855c Compare December 4, 2025 14:37
@romm
Copy link
Member

romm commented Dec 5, 2025

Hi @thePanz, thanks for the PR!

I'll take some time to think whether or not I want this in the core. If we merge it, we probably have to adapt the documentation as well.

@thePanz
Copy link
Contributor Author

thePanz commented Dec 5, 2025

Thanks 👍
... and be aware of: #764 as I discovered while implementing those 😓

@thePanz
Copy link
Contributor Author

thePanz commented Dec 5, 2025

@romm to add on this: I would add some tests too, and apply the documentation changes before merging.
(I also have a CustomDateTimeTransformer which I would like to add)

Pro of having them in core:

  1. code reuse, so others can benefit from those common-usecases
  2. cover their usage with tests, avoiding NormalizerBuilder::registerTransformer() with invokable class #764 in the first place (and having examples documented as tests too 😊 )
  3. the Symfony bundle could pre-package some of those, or having them configured via the Symfony configuration system (just an idea)

@romm
Copy link
Member

romm commented Dec 5, 2025

👍

The CustomDateTimeTransformer would also make sense if we were to add them in the core.

Just so you known, there is an existing test (that should be moved/adapted): https://github.com/CuyZ/Valinor/blob/194c0cdfa7bc3f23e3c5d254f42acf3ecef5a46a/tests/Integration/Normalizer/CommonExamples/ObjectKeysToSnakeCaseTest.php

@thePanz thePanz force-pushed the introduce-common-normalizer-transformers branch 9 times, most recently from 6028142 to cc96f30 Compare December 9, 2025 08:11
@thePanz thePanz force-pushed the introduce-common-normalizer-transformers branch 2 times, most recently from 745041d to 74f7d03 Compare December 9, 2025 08:25
@thePanz thePanz force-pushed the introduce-common-normalizer-transformers branch from 74f7d03 to 576c038 Compare December 9, 2025 08:43
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.

2 participants