PHPackages                             mrkrstphr/hydrotron - 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. mrkrstphr/hydrotron

ActiveLibrary

mrkrstphr/hydrotron
===================

Hydrotron aids in hydrating PHP objects

2.1.0(9y ago)15.1k1MITPHPPHP &gt;=7.0,&lt;=8.0

Since Mar 7Pushed 8y agoCompare

[ Source](https://github.com/mrkrstphr/hydrotron)[ Packagist](https://packagist.org/packages/mrkrstphr/hydrotron)[ RSS](/packages/mrkrstphr-hydrotron/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (6)Dependencies (5)Versions (9)Used By (0)

hydrotron
=========

[](#hydrotron)

Hydrotron aids in hydrating PHP objects

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

[](#installation)

```
composer install mrkrstphr/hydrotron

```

Usage
-----

[](#usage)

When an array key exists, call one or more callbacks:

```
$hydro = new Hydrotron(['foo' => 'bar']);
$hydro->when('foo', $callback, [$object, 'method']);
```

When an array key exists, instantiate an object, and call a series of callbacks with that object:

```
$hydro = new Hydrotron(['foo' => 'bar', 'bizz' => 'buzz']);
$hydro->instantiateWhen('foo', MyClass::class, $callback);
```

`instantiateWhen()` uses [Instantiator](https://github.com/mrkrstphr/instantiator), which will analyze the classes constructor arguments and pass the values of any keys within the `Hydrotron`array that matches those argument names.

So if `MyClass` looked like:

```
class MyClass {
    public function __construct($foo, $bizz) {}
}
```

`MyClass` would be instantiated with `$foo = 'bar'` and `$bizz = 'buzz'`. If an argument name is not found within the array, `null` will be passed.

Credits
-------

[](#credits)

Hydrotron was inspired by [Keyper](https://github.com/varsitynewsnetwork/keyper).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity73

Established project with proven stability

 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

Every ~78 days

Recently: every ~17 days

Total

7

Last Release

3247d ago

Major Versions

0.1.0 → 2.0.02017-04-13

1.1.0 → 2.1.02017-04-19

PHP version history (2 changes)0.1.0PHP &gt;=7.0,&lt;=8.0

1.0.0PHP &gt;=5.5,&lt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f39f45560ed9b3d4875a2e0dbb435a1caadcbb12a0d24469d8fcf7bab5cab8be?d=identicon)[mrkrstphr](/maintainers/mrkrstphr)

---

Top Contributors

[![mrkrstphr](https://avatars.githubusercontent.com/u/164472?v=4)](https://github.com/mrkrstphr "mrkrstphr (7 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mrkrstphr-hydrotron/health.svg)

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

PHPackages © 2026

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