PHPackages                             zelenin/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. zelenin/hydrator

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

zelenin/hydrator
================

Object hydrator

0.0.2(9y ago)4138MITPHPPHP &gt;=7.0

Since Jun 8Pushed 9y ago1 watchersCompare

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

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

Hydrator [![Build Status](https://camo.githubusercontent.com/aa663595915d55daa4265225b19db73c2519ed36491cdda2cec9ec2585d02f69/68747470733a2f2f7472617669732d63692e6f72672f7a656c656e696e2f6879647261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/zelenin/hydrator) [![Coverage Status](https://camo.githubusercontent.com/7e3515bb3639919d9e100de2130b642572ee317ed063ffdaf8f7c2235c0737fb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7a656c656e696e2f6879647261746f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/zelenin/hydrator?branch=master)
===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#hydrator--)

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

[](#installation)

### Composer

[](#composer)

The preferred way to install this extension is through [Composer](http://getcomposer.org/).

Either run

```
php composer.phar require zelenin/hydrator "~0.0.1"

```

or add

```
"zelenin/hydrator": "~0.0.1"

```

to the require section of your `composer.json`

Usage
-----

[](#usage)

### Example

[](#example)

```
$entity = new Entity(5, 'Title');

$hydrator = new StrategyHydrator(new ReflectionStrategy(), new RawNamingStrategy());

$data = $hydrator->extract($entity);
// $data = ['id' => 5, 'name' => 'Title']

$data = ['id' => 10, 'name' => 'New title'];

$newEntity = $hydrator->hydrate($entity, $data);
// $newEntity->getId() = 10, $newEntity->getName() = 'New title'
```

Author
------

[](#author)

[Aleksandr Zelenin](https://github.com/zelenin/), e-mail:

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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 ~13 days

Total

2

Last Release

3296d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0de51e0d5cd7141a2189ae926d4a3c449d5d41fda7c6b63b08869eb3c1e53b9a?d=identicon)[zelenin](/maintainers/zelenin)

---

Top Contributors

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

---

Tags

hydratorobjectphpphp7hydratorextractorobject hydration

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k13.2M162](/packages/cuyz-valinor)[helgesverre/extractor

AI-Powered Data Extraction for your Laravel application.

22333.1k](/packages/helgesverre-extractor)[samdark/hydrator

Allows to extract data from an object or create a new object based on data for the purpose of persisting state. Works with private and protected properties.

11478.2k](/packages/samdark-hydrator)[mmoreram/extractor

Extractor project for php

21133.6k8](/packages/mmoreram-extractor)[nutgram/hydrator

Hydrator for PHP 8.0+

12320.2k9](/packages/nutgram-hydrator)[sunrise/hydrator

A flexible strictly-typed hydrator.

2132.4k5](/packages/sunrise-hydrator)

PHPackages © 2026

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