PHPackages                             crodas/easy-serializer - 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. crodas/easy-serializer

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

crodas/easy-serializer
======================

Serialize things easily, with validation support.

010PHP

Since Jan 6Pushed 11y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

EasySerializer
==============

[](#easyserializer)

Serialize/deserialize and validate data structures. It uses annotations to declare data structures formats and their validations.

How does it work?
-----------------

[](#how-does-it-work)

```
$conf = new EasySerializer\Configuration(__DIR__/* directory where the classes are defined */);
$serializer = $conf->getSerializer();
```

We have our serializer object, it have *two* main methods, `serialize` and `deserialize`. The serializer configuraiton object will walk through our directories the first time looking for classes with the `@Serialize` annotation. It will read their properties to understand their format and validations.

```
/** @Serialize */
class Foobar
{
   /** @Required @String */
   public $name;

   /** @Int @Between([18,99], "Age is invalid") */
   public $age;
}
```

By default, it will read and write json objects but it's easier to change the serialize/deserialize functions at runtime (with the `setFunction($serialize, $deserialize)` method).

TODO
----

[](#todo)

1. More unit testing
2. More documentation
3. More documentation for `crodas/validator`

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

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://avatars.githubusercontent.com/u/36463?v=4)[C](/maintainers/crodas)[@crodas](https://github.com/crodas)

---

Top Contributors

[![crodas](https://avatars.githubusercontent.com/u/36463?v=4)](https://github.com/crodas "crodas (9 commits)")

### Embed Badge

![Health badge](/badges/crodas-easy-serializer/health.svg)

```
[![Health](https://phpackages.com/badges/crodas-easy-serializer/health.svg)](https://phpackages.com/packages/crodas-easy-serializer)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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