patchlevel / hydrator
A library for seamless hydration of objects to arrays - and back again, optimized for developer experience and performance
2.0.0
2026-06-15 11:53 UTC
Requires
- php: ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
- ext-openssl: *
- psr/cache: ^2.0.0 || ^3.0.0
- psr/simple-cache: ^2.0.0 || ^3.0.0
- symfony/type-info: ^7.3.0 || ^8.0.0
Requires (Dev)
- infection/infection: ^0.32.4
- patchlevel/coding-standard: ^1.3.0
- phpat/phpat: ^0.12.2
- phpbench/phpbench: ^1.4.3
- phpstan/phpstan: ^2.1.39
- phpstan/phpstan-phpunit: ^2.0.15
- phpunit/phpunit: ^11.5.53
- symfony/var-dumper: ^5.4.29 || ^6.4.0 || ^7.0.0 || ^8.0.0
This package is auto-updated.
Last update: 2026-06-15 12:02:45 UTC
README
Hydrator
"A library for seamless hydration of objects to arrays - and back again, optimized for developer experience and performance."
Features
- Extract objects to arrays and hydrate them back, without calling the constructor
- Works with
final,readonlyclasses, property promotion and deeply nested structures - Automatic normalizer resolution for enums, date types, collections, array shapes and objects
- Rename or exclude fields with attributes
- Lazy hydration of objects with PHP 8.4 lazy proxies
- Pluggable guessers and extensions to customize the process
- Safe usage of Personal Data with crypto-shredding
- Metadata caching with any PSR-6 or PSR-16 cache
- Developer experience oriented and fully typed
- and much more...
Installation
composer require patchlevel/hydrator
Documentation
Integration
Contributing
We are open to contributions as long as they are in line with our BC-Policy.
Also note that the composer.lock is always generated with the newest supported PHP version as this is the version our tools run in the CI.