PHPackages                             abivia/hydration - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. abivia/hydration

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

abivia/hydration
================

Support for creating complex nested class structures from JSON/YAML objects.

2.7.0(1y ago)344.4k↑296.2%2MITPHPPHP ^8.1

Since Apr 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/abivia/hydration)[ Packagist](https://packagist.org/packages/abivia/hydration)[ Docs](https://github.com/abivia/hydration)[ RSS](/packages/abivia-hydration/feed)WikiDiscussions main Synced 1w ago

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

Abivia\\Hydration
=================

[](#abiviahydration)

[![coverage report](https://camo.githubusercontent.com/a3a30bd3580484abb6334267c512808c6f0fee80dcb7c0dbaf5bc92b8e500c05/68747470733a2f2f6769746c61622e636f6d2f6162697669612f687964726174696f6e2f6261646765732f6d61696e2f636f7665726167652e737667)](https://gitlab.com/abivia/hydration/-/commits/main)[![pipeline status](https://camo.githubusercontent.com/1e66ab4d73370872ff5edbb07e70bb32386d627b115c8c7bc54bb559303b9cbb/68747470733a2f2f6769746c61622e636f6d2f6162697669612f687964726174696f6e2f6261646765732f6d61696e2f706970656c696e652e737667)](https://gitlab.com/abivia/hydration/-/commits/main)

Hydration is designed to make JSON and YAML configuration files more user intuitive while providing robust validation and smart creation of data structures via a fluent, easily configured interface.

Overview
--------

[](#overview)

Hydration:

- Populates complex data structures from user editable JSON or YAML sources.
- Allows your application to validate inputs, including ensuring that required properties are present.

Encoding (dehydration?) facilities can transform your application data structures into objects for encoding as JSON/YAML, automatically removing unwanted properties, rearranging properties into a user-friendly order, removing properties with default values and simplifying redundant constructs to improve usability.

If your application:

- has configurations with several levels of nesting,
- needs to validate user editable data in configuration files,
- is spending a lot of effort converting the stdClass objects created by `json_decode()` or `yaml_parse()` to your application's class structures, or
- is just using `stdClass` objects for configuration

then Hydration is here to help.

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

[](#installation)

`composer require abivia/hydration`

Hydration uses the YAML Symphony parser and will suggest it at install.

Documentation
-------------

[](#documentation)

Documentation is available on the [Hydration Site](https://hydration.abivia.com).

Contributing and Code of Conduct
--------------------------------

[](#contributing-and-code-of-conduct)

Please see CONTRIBUTING.md.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance44

Moderate activity, may be stable

Popularity33

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

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

Recently: every ~316 days

Total

37

Last Release

441d ago

Major Versions

0.5.3 → 1.0.02019-12-19

1.0.11 → 2.0.02021-07-28

1.1.1 → 2.0.12021-09-07

PHP version history (5 changes)0.1.0PHP &gt;=7.1

1.0.5PHP &gt;=7.2

2.0.0PHP &gt;=7.3

1.1.0PHP &gt;=7.4|^8.0

2.7.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/42cd72dce530e94e60853407cdab69ead232423272b482218ae686c740ce0e99?d=identicon)[abivia](/maintainers/abivia)

---

Top Contributors

[![instancezero](https://avatars.githubusercontent.com/u/2599327?v=4)](https://github.com/instancezero "instancezero (151 commits)")

---

Tags

jsonconfigurationconfigyamldeserializationhydration

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/abivia-hydration/health.svg)

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

###  Alternatives

[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

1.0k13.7M181](/packages/hassankhan-config)[thewunder/conphigure

Framework Agnostic Configuration Library

3119.1k](/packages/thewunder-conphigure)[yosymfony/config-loader

Configuration file loader

11110.3k3](/packages/yosymfony-config-loader)[m1/vars

Vars is a simple to use and easily extendable configuration loader with in built loaders for ini, json, PHP, toml, XML and yaml/yml file types. It also comes with in built support for Silex and more frameworks to come soon.

64124.3k1](/packages/m1-vars)[northwoods/config

Simple configuration loader

1616.0k](/packages/northwoods-config)

PHPackages © 2026

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