tempestphp / tempest-framework

The PHP framework that gets out of your way 🌊
https://tempestphp.com
MIT License
813 stars 55 forks source link

feat: allow object to define how they are mapped to array #532

Closed Jeroen-G closed 5 hours ago

Jeroen-G commented 17 hours ago

I wrote an object that I wanted to be mapped to array differently then just property -> value. PHP supports this with the JsonSerialize interface. So I wrote a simple check (with test) for that!

For the example, I think the test speaks for itself.

brendt commented 5 hours ago

Makes sense 👍