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

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

meow/hydrator
=============

v1.3.0(2y ago)21.4k[1 PRs](https://github.com/meowphp/hydrator/pulls)1MITPHPPHP &gt;=8.0CI failing

Since Nov 14Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/meowphp/hydrator)[ Packagist](https://packagist.org/packages/meow/hydrator)[ GitHub Sponsors](https://github.com/maymeow)[ Fund](https://ko-fi.com/maymeow)[ RSS](/packages/meow-hydrator/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (7)Dependencies (3)Versions (12)Used By (1)

Hydrator
========

[](#hydrator)

**namespace:** `Meow\Hydrator`

Library that can hydrate (fill object with data from array) and extract data from object back to array.

[![ko-fi](https://camo.githubusercontent.com/201ef269611db7eb6b5d08e9f756ab8980df3014b64492770bdf13a6ed924641/68747470733a2f2f6b6f2d66692e636f6d2f696d672f676974687562627574746f6e5f736d2e737667)](https://ko-fi.com/D1D5DMOTA)

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

[](#installation)

To install this library into your project use composer script:

```
composer require meow/hydrator
```

Usage
-----

[](#usage)

### Hydrate

[](#hydrate)

Filling object from array

```
protected array $testModelData = [
    "name" => "May",
    'email' => 'may@locahlost.tld'
];
// ...
$hydrator = new Hydrator();
$testModel = $hydrator->hydrate(TestModel::class, $this->testModelData);
```

### Extract

[](#extract)

Extraction properties and their values back to the array.

```
$testModelDataArray = $hydrator->extract($testModel, ['name', 'email']);
```

### Arrays of objects

[](#arrays-of-objects)

You can now parse arrays of objects by defining them with the attribute `ArrayOf`. Check following snippet

```
// ...
use Meow\Hydrator\Attributes\ArrayOf;

class Character
{
// ...
protected Equipment $equipment;

#[ArrayOf(Weapon::class)]
protected array $inventory;
// ...
}
```

**License: MIT**

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance49

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Recently: every ~180 days

Total

6

Last Release

971d ago

### Community

Maintainers

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[kss-php/kss-php

A PHP implementation of KSS: a methodology for documenting CSS and generating styleguides

23142.7k2](/packages/kss-php-kss-php)

PHPackages © 2026

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