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

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

gember/serializer-symfony
=========================

Gember Event Sourcing Serializer adapter based on symfony/serializer

0.11.0(7mo ago)1884[1 PRs](https://github.com/GemberPHP/serializer-symfony/pulls)2MITPHPPHP ^8.3CI passing

Since Apr 28Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/GemberPHP/serializer-symfony)[ Packagist](https://packagist.org/packages/gember/serializer-symfony)[ RSS](/packages/gember-serializer-symfony/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (11)Versions (13)Used By (2)

🫚 Gember Serializer: Symfony Serializer
=======================================

[](#-gember-serializer-symfony-serializer)

[![Build Status](https://camo.githubusercontent.com/c79a3a3ffbe89a85eff08a333fc500521f046d7959552134bdc81eef72b8d571/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f47656d6265725048502f73657269616c697a65722d73796d666f6e792f6261646765732f6275696c642e706e673f623d6d61696e)](https://github.com/GemberPHP/serializer-symfony/actions)[![Coverage Status](https://camo.githubusercontent.com/64816f6f35f62a39069f145574bccaaa9f9ad58decc9d867ca9e82f74780f0a6/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f47656d6265725048502f73657269616c697a65722d73796d666f6e792e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/GemberPHP/serializer-symfony/code-structure)[![Quality Score](https://camo.githubusercontent.com/8f824e1a91d967401d02b2abcce9ee6f26062c976111fcc48fd6486232eceeb4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f47656d6265725048502f73657269616c697a65722d73796d666f6e792e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/GemberPHP/serializer-symfony)[![Software License](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/05de8fa997dec7bd6b39b7af8c030c734835c6871547f8b2d9ae87e4299ebc8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e332d3838393242462e7376673f7374796c653d666c6174)](http://www.php.net)

[Gember Event Sourcing](https://github.com/GemberPHP/event-sourcing) Serializer adapter based on [symfony/serializer](https://github.com/symfony/serializer).

> All external dependencies in Gember Event Sourcing are organized into separate packages, making it easy to swap out a vendor adapter for another.

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

[](#installation)

Install with Composer:

```
composer require gember/serializer-symfony
```

Configuration
-------------

[](#configuration)

Bind this adapter to the `Serializer` interface in your service definitions.

### Examples

[](#examples)

#### Vanilla PHP

[](#vanilla-php)

```
use Gember\SerializerSymfony\SymfonySerializer;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;

$serializer = new SymfonySerializer(
    new Serializer(
        [
            new DateTimeNormalizer([
                DateTimeNormalizer::FORMAT_KEY => 'Y-m-d\TH:i:s.uP',
            ]),
            new ObjectNormalizer(),
        ],
        [
            new JsonEncoder(),
        ],
    ),
);
```

#### Symfony

[](#symfony)

It is recommended to use the [Symfony bundle](https://github.com/GemberPHP/event-sourcing-symfony-bundle) to configure Gember Event Sourcing. With this bundle, the adapter is automatically set as the default for the Serializer.

If you're not using the bundle, you can either add the serializer to the existing stack of serializers or bind it directly to the `Serializer` interface.

Option 1: Add to the existing stack of serializers:

```
Gember\SerializerSymfony\SymfonySerializer:
  arguments:
    - '@serializer' # or any other Symfony Serializer definition of your choice

Gember\EventSourcing\Util\Serialization\Serializer\SerializableDomainEvent\SerializableDomainEventSerializer: ~

Gember\DependencyContracts\Util\Serialization\Serializer\Serializer:
  class: Gember\EventSourcing\Util\Serialization\Serializer\Stacked\StackedSerializer
  arguments:
    - [
        '@Gember\EventSourcing\Util\Serialization\Serializer\SerializableDomainEvent\SerializableDomainEventSerializer',
        '@Gember\SerializerSymfony\SymfonySerializer' # added to stack of serializers
    ]
```

Option 2: Bind directly to `Serializer` interface:

```
Gember\DependencyContracts\Util\Serialization\Serializer\Serializer:
  class: Gember\SerializerSymfony\SymfonySerializer
  arguments:
    - '@serializer' # or any other Symfony Serializer definition of your choice
```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance78

Regular maintenance activity

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.8% 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 ~26 days

Recently: every ~33 days

Total

11

Last Release

216d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4119451?v=4)[Jeroen](/maintainers/jerowork)[@jerowork](https://github.com/jerowork)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (75 commits)")[![jerowork](https://avatars.githubusercontent.com/u/4119451?v=4)](https://github.com/jerowork "jerowork (31 commits)")

---

Tags

cqrsdcbddddomain-driven-designdynamic-consistency-boundaryevent-sourcinggemberserializersymfonysymfonyserializerDomain Driven Designdddevent sourcingcqrsgember

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k52.2M378](/packages/api-platform-core)[api-platform/symfony

Symfony API Platform integration

385.0M152](/packages/api-platform-symfony)[api-platform/serializer

API Platform core Serializer

295.3M101](/packages/api-platform-serializer)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1617.3k16](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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