patchlevel/hydrator

A library for seamless hydration of objects to arrays - and back again, optimized for developer experience and performance

Maintainers

👁 DavidBadura

Package info

github.com/patchlevel/hydrator

Homepage

pkg:composer/patchlevel/hydrator

Statistics

Installs: 587 389

Dependents: 3

Suggesters: 0

Stars: 17

Open Issues: 10

2.0.0 2026-06-15 11:53 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 1c37e647aa36e058ab27358a7ce798f0f87b0413

  • Daniel Badura <daniel.badura.woop@patchlevel.de>
  • David Badura <david.badura.woop@patchlevel.de>

serializerhydratornormalizerdenormalizerobject mappingpatchlevel

This package is auto-updated.

Last update: 2026-06-28 19:14:46 UTC


README

👁 Mutation testing badge
👁 Latest Stable Version
👁 License

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, readonly classes, 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.