PHPackages                             patchlevel/hydrator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. patchlevel/hydrator

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

patchlevel/hydrator
===================

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

2.0.0(2mo ago)17622.4k↓39.5%3[1 issues](https://github.com/patchlevel/hydrator/issues)[7 PRs](https://github.com/patchlevel/hydrator/pulls)3MITPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Feb 20Pushed 3w ago3 watchersCompare

[ Source](https://github.com/patchlevel/hydrator)[ Packagist](https://packagist.org/packages/patchlevel/hydrator)[ Docs](https://patchlevel.dev/docs/hydrator/latest)[ RSS](/packages/patchlevel-hydrator/feed)WikiDiscussions 2.1.x Synced 2w ago

READMEChangelog (10)Dependencies (47)Versions (99)Used By (3)

[![Mutation testing badge](https://camo.githubusercontent.com/08bcae324a44635719b975526bc6b6d840e62d100cb1567c8dcb3ef19017c6d5/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d25324670617463686c6576656c2532466879647261746f72253246322e302e78)](https://dashboard.stryker-mutator.io/reports/github.com/patchlevel/hydrator/2.0.x)[![Latest Stable Version](https://camo.githubusercontent.com/6481d603697d852b5dcd1e4eda194443c9c9e45e834b86c39359d1ce831aec28/68747470733a2f2f706f7365722e707567782e6f72672f70617463686c6576656c2f6879647261746f722f76)](//packagist.org/packages/patchlevel/hydrator)[![License](https://camo.githubusercontent.com/c5604acf4c64abde19cd007d60353d01630f93ee7f65eee48a308efafcc66103/68747470733a2f2f706f7365722e707567782e6f72672f70617463686c6576656c2f6879647261746f722f6c6963656e7365)](//packagist.org/packages/patchlevel/hydrator)

Hydrator
========

[](#hydrator)

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

Features
--------

[](#features)

- Extract objects to arrays and [hydrate](https://patchlevel.dev/docs/hydrator/latest/hydrator) them back, without calling the constructor
- Works with `final`, `readonly` classes, property promotion and deeply nested structures
- Automatic [normalizer](https://patchlevel.dev/docs/hydrator/latest/normalizer) resolution for enums, date types, collections, array shapes and objects
- [Rename or exclude](https://patchlevel.dev/docs/hydrator/latest/hydrator) fields with attributes
- [Lazy hydration](https://patchlevel.dev/docs/hydrator/latest/lazy) of objects with PHP 8.4 lazy proxies
- Pluggable [guessers](https://patchlevel.dev/docs/hydrator/latest/guesser) and [extensions](https://patchlevel.dev/docs/hydrator/latest/extensions) to customize the process
- Safe usage of Personal Data with [crypto-shredding](https://patchlevel.dev/docs/hydrator/latest/cryptography)
- [Metadata caching](https://patchlevel.dev/docs/hydrator/latest/caching) with any PSR-6 or PSR-16 cache
- Developer experience oriented and fully typed
- and much more...

Installation
------------

[](#installation)

```
composer require patchlevel/hydrator
```

Documentation
-------------

[](#documentation)

- Latest [Docs](https://patchlevel.dev/docs/hydrator/latest)
- Related [Blog](https://patchlevel.dev/blog)

Integration
-----------

[](#integration)

- [Event Sourcing](https://github.com/patchlevel/event-sourcing)

Contributing
------------

[](#contributing)

We are open to contributions as long as they are in line with our [BC-Policy](https://patchlevel.dev/our-backward-compatibility-promise).

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.

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance90

Actively maintained with recent releases

Popularity47

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 50.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Recently: every ~12 days

Total

67

Last Release

20d ago

Major Versions

1.24.0 → 2.0.02026-06-15

PHP version history (6 changes)1.0.0-beta1PHP ~8.1.0 || ~8.2.0

1.1.x-devPHP ~8.1.0 || ~8.2.0 || ~8.3.0

1.6.x-devPHP ~8.2.0 || ~8.3.0

1.7.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0

1.12.x-devPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

1.13.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/470138?v=4)[David Badura](/maintainers/DavidBadura)[@DavidBadura](https://github.com/DavidBadura)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (356 commits)")[![DavidBadura](https://avatars.githubusercontent.com/u/470138?v=4)](https://github.com/DavidBadura "DavidBadura (287 commits)")[![DanielBadura](https://avatars.githubusercontent.com/u/2017762?v=4)](https://github.com/DanielBadura "DanielBadura (52 commits)")[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (5 commits)")[![wikando-ck](https://avatars.githubusercontent.com/u/73299324?v=4)](https://github.com/wikando-ck "wikando-ck (2 commits)")

---

Tags

ddddtoserializationnormalizerserializerhydratordenormalizerpatchlevelobject-mapping

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/patchlevel-hydrator/health.svg)

```
[![Health](https://phpackages.com/badges/patchlevel-hydrator/health.svg)](https://phpackages.com/packages/patchlevel-hydrator)
```

###  Alternatives

[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k52.2M378](/packages/api-platform-core)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M674](/packages/shopware-core)[api-platform/metadata

API Resource-oriented metadata attributes and factories

275.5M254](/packages/api-platform-metadata)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M777](/packages/sylius-sylius)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86337.5k](/packages/flow-php-flow)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
