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

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

yadddl/serializer
=================

Yet another Serializer library

v0.6.0(4y ago)0117MITPHPPHP ^8.0|^8.1

Since Dec 17Pushed 4y ago1 watchersCompare

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

READMEChangelogDependencies (7)Versions (4)Used By (0)

Yet Another Serializer Library (YASL)
=====================================

[](#yet-another-serializer-library-yasl)

by Yet Another DDD Library (YADDDL)
-----------------------------------

[](#by-yet-another-ddd-library-yadddl)

This library implements a serializer, and it follows those rules:

- **Do not use extra metadata:** the PHP language is expressive enough to give you everything you need.
- **Convention over configuration:** just configure what differ from the standard use case, that already cover the majority of the cases.

It goes in-pair with the [Value Object](https://github.com/yadddl/value-object) project of the same family, but could be used alone. Just be sure to follow the [conventions](docs/conventions.md)!

It doesn't cover all the possibile use cases, then use it if you want, or contribute if you like what we are doing and want to expand it.

Usage
-----

[](#usage)

```
composer require yadddl/serializer

```

Getting started
---------------

[](#getting-started)

Given a simple DTO

```
class SillyDTO {
    public function __construct(
        private string $propertyOne,
        private int $propertyTwo,
        private string $hiddenProperty
    ) {}

    public function getPropertyOne(): string
    {
        return $this->propertyOne;
    }

    public function getPropertyTwo(): int
    {
        return $this->propertyTwo;
    }
}
```

The easy way to serialize it is this one

```
use Yadddl\Serializer\Factory\SerializerBaseFactory;

// Fastest way to create a basic serializer
$serializer = SerializerBaseFactory::make();

$dto = new SillyDTO('one', 2, 'hidden');

$data = $serializer->serialize($dto);

echo json_encode($data, JSON_PRETTY_PRINT);
```

And the resulting json

```
{
    "propertyOne": "one",
    "propertyTwo": 2
}
```

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

[](#documentation)

- [Conventions](docs/conventions.md)
- [Configuration](docs/configuration.md)
- [Override a serializer](docs/override_serializer.md)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

1558d ago

PHP version history (2 changes)v0.5.0PHP &gt;=8.0

v0.6.0PHP ^8.0|^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/10b75e2cb39cb0beafd94238c476a67ea60b23b102eb66d5068138a1114baa08?d=identicon)[cnastasi](/maintainers/cnastasi)

---

Top Contributors

[![cnastasi](https://avatars.githubusercontent.com/u/2204693?v=4)](https://github.com/cnastasi "cnastasi (11 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[symfony/serializer-pack

A pack for the Symfony serializer

1.1k28.2M221](/packages/symfony-serializer-pack)[jolicode/automapper

JoliCode AutoMapper

213439.4k7](/packages/jolicode-automapper)[egeloen/json-builder

JSON builder with escaping control for PHP 5.6+

965.7M9](/packages/egeloen-json-builder)

PHPackages © 2026

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