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

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

orbiter/hydrator
================

PHP Object Hydrator using Reflection.

0.1.1(3y ago)0512MITPHPPHP ~8.0|~8.1

Since Oct 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/bemit/orbiter-hydrator)[ Packagist](https://packagist.org/packages/orbiter/hydrator)[ Docs](https://bemit.codes)[ RSS](/packages/orbiter-hydrator/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Orbiter\\Hydrator
=================

[](#orbiterhydrator)

[![Latest Stable Version](https://camo.githubusercontent.com/ae6d214516539311ecceb4bb883b3966a453b9907f16561fc0d3c0a3ce232034/68747470733a2f2f706f7365722e707567782e6f72672f6f7262697465722f6879647261746f722f76657273696f6e2e737667)](https://packagist.org/packages/orbiter/hydrator)[![Latest Unstable Version](https://camo.githubusercontent.com/626719e0480fbc0a593ae5847f7bf03bd138ccb15efce745c676b4b7ca968293/68747470733a2f2f706f7365722e707567782e6f72672f6f7262697465722f6879647261746f722f762f756e737461626c652e737667)](https://packagist.org/packages/orbiter/hydrator)[![codecov](https://camo.githubusercontent.com/6279098e93e459239e127e6be1e041ffebb75f7d52c8568716558592e819f608/68747470733a2f2f636f6465636f762e696f2f67682f62656d69742f6f7262697465722d6879647261746f722f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d3162575737706c463143)](https://codecov.io/gh/bemit/orbiter-hydrator)[![Total Downloads](https://camo.githubusercontent.com/1caed519bbf865dda2c06052fddf5975ecf2317904997a12d74af4f35b03875a/68747470733a2f2f706f7365722e707567782e6f72672f6f7262697465722f6879647261746f722f646f776e6c6f6164732e737667)](https://packagist.org/packages/orbiter/hydrator)[![Github actions Build](https://github.com/bemit/orbiter-hydrator/actions/workflows/blank.yml/badge.svg)](https://github.com/bemit/orbiter-hydrator/actions)[![PHP Version Require](https://camo.githubusercontent.com/74dc3239fa71df9fd5643758f22ad8fc34609a7c71f6fa1dc27df69f0fed99d0/687474703a2f2f706f7365722e707567782e6f72672f6f7262697465722f6879647261746f722f726571756972652f706870)](https://packagist.org/packages/orbiter/hydrator)

Hydrator to create PHP objects from data, using Reflections, use e.g. PSR Container through a [FactoryInterface](https://github.com/bemit/orbiter-hydrator/blob/master/src/FactoryInterface.php).

```
composer require orbiter/hydrator
```

```
// needs implementation:
// $factory = \Orbiter\Hydrator\FactoryInterface()
$hydrator = new \Orbiter\Hydrator\Hydrator($factory);

// params = e.g. most likely used by your factory for __construct, array of params
$hydrator->make($class_name, $params);

// data = use to hydrate after instance creation, can be associative array or stdClass
//        uses keys/properties as names for the property to inject
// third parameter = true ignores missing properties
$hydrator->hydrate($class, $data, false);
$hydrator->makeAndInject($class_name, $data, false, $params);

//
// for PHP-DI users:
use function DI\autowire;
use function DI\get;

$dependencies = [
    Orbiter\Hydrator\BridgePHPDIFactory::class => autowire()
        ->constructorParameter('factory', get(DI\FactoryInterface::class)),
    Orbiter\Hydrator\Hydrator::class => autowire()
        ->constructorParameter('factory', get(Orbiter\Hydrator\BridgePHPDIFactory::class)),
]

```

Dev Notices
-----------

[](#dev-notices)

Commands to set up and run e.g. tests:

```
# on windows:
docker run -it --rm -v %cd%:/app composer install

docker run -it --rm -v %cd%:/var/www/html php:8.1-cli-alpine sh

docker run --rm -v %cd%:/var/www/html php:8.1-cli-alpine sh -c "cd /var/www/html && ./vendor/bin/phpunit --testdox -c phpunit-ci.xml --bootstrap vendor/autoload.php"

# on unix:
docker run -it --rm -v `pwd`:/app composer install

docker run -it --rm -v `pwd`:/var/www/html php:8.1-cli-alpine sh

docker run --rm -v `pwd`:/var/www/html php:8.1-cli-alpine sh -c "cd /var/www/html && ./vendor/bin/phpunit --testdox -c phpunit-ci.xml --bootstrap vendor/autoload.php"
```

Versions
--------

[](#versions)

This project adheres to [semver](https://semver.org/), **until `1.0.0`** and beginning with `0.1.0`: all `0.x.0` releases are like MAJOR releases and all `0.0.x` like MINOR or PATCH, modules below `0.1.0` should be considered experimental.

License
-------

[](#license)

This project is free software distributed under the [**MIT LICENSE**](LICENSE).

### Contributors

[](#contributors)

By committing your code to the code repository you agree to release the code under the MIT License attached to the repository.

---

Maintained by [Michael Becker](https://mlbr.xyz)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Every ~360 days

Total

2

Last Release

1306d ago

PHP version history (2 changes)0.1.0PHP ~8.0||~8.1

0.1.1PHP ~8.0|~8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/946489901a36f4507ead2ce24d3e9c6570ae4e16ab1aed0ef6314237302ecb37?d=identicon)[bemit](/maintainers/bemit)

---

Top Contributors

[![elbakerino](https://avatars.githubusercontent.com/u/7737034?v=4)](https://github.com/elbakerino "elbakerino (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[illuminate/contracts

The Illuminate Contracts package.

704122.9M10.1k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31278.1M2.0k](/packages/illuminate-container)[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[symfony/object-mapper

Provides a way to map an object to another object

34885.7k18](/packages/symfony-object-mapper)

PHPackages © 2026

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