🔔 #PHP object-mapper library Valinor v2.4.0 released!

🚀 This huge release brings exciting new features:

- Out of the box HTTP request mapping
- Mapper/normalizer configurators
- CamelCase/snake_case keys conversion
- Keys case restriction

https://github.com/CuyZ/Valinor/releases/tag/2.4.0

⤵️ see below for more details ⤵️

🔥 HTTP request mapping

Valinor now provides a way to map an HTTP request to controller parameters or object properties.

This gives controllers a clean, type-safe signature without coupling to a framework's request object, while benefiting from the library's validation and error handling.

⤵️

This feature contains several parts:

- Attributes to enforce route/query/body source
- Mapping a whole query/body to single parameter
- Mapping the HTTP request to an object
- PSR-7 support
- And of course, advanced types support and strict error handling with human-readable messages

⤵️

The Symfony bundle has been updated to support this feature out of the box!

More info: https://github.com/CuyZ/Valinor-Bundle#http-request-mapping

⤵️

The awesome @ocramius has been working on a native integration with Mezzio!

This means being able to *very easily* map PSR-7 requests to strictly-typed objects!

Look at the example below to see how trivial it becomes.

More info: https://github.com/mezzio/mezzio-valinor

⤵️

🔥 This release also brings support for mapper/normalizer configurators: reusable piece of configuration logic.

This is useful when the same configuration needs to be applied in multiple places across an application, or when configuration logic needs to be distributed as a package.

✨ And the first configurators provided out of the box are the case conversion configurators: automatically convert source keys to `camelCase` or `snake_case` formats!

⤵️

✨ We also got you covered for when you want to enforce the key case…

⤵️

Grab it while it's hot 🔥

`composer require cuyz/valinor:^2.4.0`

I maintain this OSS project on my spare time — if you want to ensure its future, please consider sponsoring my work 🤗

https://github.com/sponsors/romm

Sponsor @romm on GitHub Sponsors

GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.

GitHub