PHPackages                             dannyb/phydrator - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. dannyb/phydrator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dannyb/phydrator
================

PHP entity hydration

v1.0(5y ago)113MITPHPPHP &gt;=7.4

Since Feb 13Pushed 5y ago1 watchersCompare

[ Source](https://github.com/DannyBattison/phydrator)[ Packagist](https://packagist.org/packages/dannyb/phydrator)[ RSS](/packages/dannyb-phydrator/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

PHydrator
=========

[](#phydrator)

A simple utility library for entity hydration in PHP.

Defining a Hydrator
-------------------

[](#defining-a-hydrator)

All that should be necessary is to have an entity class (using PHP7.4+ property types), and then a very simple class such as this:

```
namespace PHydrator\Hydrator;

use PHydrator\AbstractHydrator;

class MyHydrator extends AbstractHydrator
{
    protected const ENTITY_CLASS = MyEntity::class;
}
```

Autoloading Hydrators
---------------------

[](#autoloading-hydrators)

The recommended method of registering hydrators is to specify a namespace in the config when initialising PHydrator:

```
use PHydrator\Config;
use PHydrator\PHydrator;
// ...
$config = new Config();
$config->autoloadNamespace = "App\\Hydrators";
$pHydrator = new PHydrator($config);
// ...
```

If an autoload namespace isn't specified, you will need to manually register your hydrators.

Note that this is also an option if you have hydrators in other namespaces.

```
use PHydrator\PHydrator;
// ...
$pHydrator = new PHydrator();
$pHydrator->registerHydrator(MyHydrator::class);
// ...
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1918d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d2cfc4a37f6379be82c2818c59d06be5eb33a0ebfc0e4b44b8bc8187f43a9c4?d=identicon)[DannyBattison](/maintainers/DannyBattison)

---

Top Contributors

[![DannyBattison](https://avatars.githubusercontent.com/u/9880796?v=4)](https://github.com/DannyBattison "DannyBattison (31 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dannyb-phydrator/health.svg)

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

###  Alternatives

[friendsofsymfony/comment-bundle

This Bundle provides threaded comment functionality for Symfony applications

460751.2k5](/packages/friendsofsymfony-comment-bundle)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[koriym/attributes

An annotation/attribute reader

433.4M12](/packages/koriym-attributes)[hostnet/entity-tracker-component

Provides an event when a Tracked entity changes

16158.1k4](/packages/hostnet-entity-tracker-component)[gomachan46/state-machine

simple state machine with annotations for PHP, inspired by AASM known as a Ruby state machine.

1893.9k](/packages/gomachan46-state-machine)[hostnet/accessor-generator-plugin-lib

Generate get, set, add, remove methods on the fly.

10118.9k](/packages/hostnet-accessor-generator-plugin-lib)

PHPackages © 2026

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