PHPackages                             indigophp/hydra - 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. indigophp/hydra

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

indigophp/hydra
===============

Easily convert array to object and object to array

1100[1 issues](https://github.com/indigophp/hydra/issues)PHP

Since Mar 28Pushed 11y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Indigo Hydra
============

[](#indigo-hydra)

[![Latest Version](https://camo.githubusercontent.com/934f3326c4a3bc3823fd3f8a85478b3c9d5dfa6bc6d6977fa08578d9f79ca5df/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f696e6469676f7068702f68796472612e7376673f7374796c653d666c61742d737175617265)](https://github.com/indigophp/hydra/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/98ef14bd4bbb5d5154dd6607a478202e39eede4dd9dc8857016fd2f2a833b225/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f696e6469676f7068702f68796472612e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/indigophp/hydra)[![Code Coverage](https://camo.githubusercontent.com/79f54e4bff5d638af3971935c81061f634254d7263a58213863385bd92f7d72a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f696e6469676f7068702f68796472612e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/indigophp/hydra)[![Quality Score](https://camo.githubusercontent.com/0a360cce92b1e874eef5a331640ec04e6c7d3354d7b640f52b70e02fdfe43ec5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f696e6469676f7068702f68796472612e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/indigophp/hydra)[![HHVM Status](https://camo.githubusercontent.com/e08539941fa6a23e33c5a8bff43f49e89fdb30104e1d42187ebe10b99165d8dd/68747470733a2f2f696d672e736869656c64732e696f2f6868766d2f696e6469676f7068702f68796472612e7376673f7374796c653d666c61742d737175617265)](http://hhvm.h4cc.de/package/indigophp/hydra)[![Total Downloads](https://camo.githubusercontent.com/80302beb69d162d72b6439830b3724cbbefdb8eb1d436129063f999ffcd0dd9e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e6469676f7068702f68796472612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/indigophp/hydra)

**Easily convert array to object and object to array.**

Install
-------

[](#install)

Via Composer

```
$ composer require indigophp/hydra
```

Usage
-----

[](#usage)

### Currently supported hydrators

[](#currently-supported-hydrators)

Hydrators can be found under `Indigo\Hydra\Hydrator` namespace.

- Generated: Inspired by **GeneratedHydrator**. Contains some custom logic, but generation logic is heavily based on the original code
- GeneratedHydrator: Uses [GeneratedHydrator](https://github.com/Ocramius/GeneratedHydrator) created by **[@Ocramius](https://github.com/Ocramius)**
- HydratableAware: It is a decorator which checks if the object implements `Indigo\Hydra\Hydratable` interface and falls back to the hydrator if not
- ObjectProperty: Maps data to, reads from public properties
- Reflection: Uses reflection to access all object properties (non-static ones)
- Zend: Allows to use hydrators from [zendframework/zend-stdlib](https://github.com/zendframework/Component_ZendStdlib) package

Testing
-------

[](#testing)

```
$ phpspec run
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Márk Sági-Kazár](https://github.com/sagikazarmark)
- [Marco Pivetta](https://github.com/Ocramius)
- [All Contributors](https://github.com/indigophp/hydra/contributors)

This library is heavily influenced by [Zend Stdlib](https://github.com/zendframework/Component_ZendStdlib), [Doctrine Hydration](https://github.com/doctrine/doctrine2/tree/master/lib/Doctrine/ORM/Internal/Hydration) and [GeneratedHydrator](https://github.com/Ocramius/GeneratedHydrator) package created by **[@Ocramius](https://github.com/Ocramius)**.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e4e105cea62b616d4cb376b08a849b6a428f646998537de150d16a8eb537b90?d=identicon)[mark.sagikazar](/maintainers/mark.sagikazar)

---

Top Contributors

[![sagikazarmark](https://avatars.githubusercontent.com/u/1226384?v=4)](https://github.com/sagikazarmark "sagikazarmark (36 commits)")

### Embed Badge

![Health badge](/badges/indigophp-hydra/health.svg)

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

PHPackages © 2026

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