PHPackages                             rebuy/serializer-jms-adapter - 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. rebuy/serializer-jms-adapter

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

rebuy/serializer-jms-adapter
============================

Adapter to use rebuy/serializer in place of jms/serializer.

2.3.0(1mo ago)52MITPHPPHP ^8.0CI passing

Since Oct 3Pushed 1mo agoCompare

[ Source](https://github.com/rebuy-oss/serializer-jms-adapter)[ Packagist](https://packagist.org/packages/rebuy/serializer-jms-adapter)[ RSS](/packages/rebuy-serializer-jms-adapter/feed)WikiDiscussions 2.x Synced 1w ago

READMEChangelog (1)Dependencies (9)Versions (10)Used By (0)

Liip Serializer JMS Adapter
===========================

[](#liip-serializer-jms-adapter)

Note

This project is based on the original work of [liip/serializer-jms-adapter](https://github.com/liip/serializer-jms-adapter). This repository is the actively maintained continuation of that project.

An adapter to make [rebuy/serializer](https://github.com/rebuy-oss/serializer) a drop-in replacement for [jms/serializer](https://github.com/schmittjoh/serializer).

Version 1 of this adapter is for integrating JMS Serializer version 1, and version 2 for JMS Serializer version 2 and 3. (Because there are BC breaks in the interfaces of JMS serializer that prevent this library from supporting JMS 1 and 2/3 with the same code.)

This library provides a serializer that attempts to use the Liip Serializer and falls back to JMS serializer on error. You need to use the `Liip\Serializer\Adapter\JMS\AdapterSerializationContext` provided in this library instead of the regular `JMS\Serializer\SerializationContext`. You can use the `Serializer\Adapter\JMS\AdapterSerializationContextFactory` when working with libraries that create the context themselves.

Usage
=====

[](#usage)

```
use JMS\Serializer\Serializer as JMSSerializer;
use Liip\Serializer\Adapter\JMS\JMSSerializerAdapter;
use Liip\Serializer\Serializer as LiipSerializer;

// see https://github.com/rebuy-oss/serializer/ for how to set up the Liip Serializer
$liipSerializer = new LiipSerializer(...);
// see https://jmsyst.com/libs/serializer for how to set up JMS Serializer
$jmsSerializer = new JMSSerializer(...);

$serializer = new JMSSerializerAdapter($liipSerializer, $jmsSerializer, new NullLogger());

// $serializer can now be used in place of $jmsSerializer
```

Using Liip Serializer only for a Subset of Models
-------------------------------------------------

[](#using-liip-serializer-only-for-a-subset-of-models)

The `JMSSerializerAdapter` accepts an additional constructor argument to specify a list of enabled classes. If that list is specified, only those classes will be attempted to handle with the Liip Serializer. If you want to use JMS Serializer for some of your models and the Liip Serializer for others, use this configuration to avoid overhead and avoid warning log entries from the adapter that you do not care about.

```
$enabledClasses = ['App\Model\Product', 'App\Model\Category'];

$serializer = new JMSSerializerAdapter($liipSerializer, $jmsSerializer, new NullLogger(), $enabledClasses);
```

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance92

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 52.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 ~266 days

Recently: every ~246 days

Total

10

Last Release

40d ago

Major Versions

1.0.0 → 2.0.02019-10-09

PHP version history (4 changes)1.0.0PHP ^7.1

2.0.0PHP ^7.2

2.1.0PHP ^7.2 || ^8.0

2.2.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/84ed641aeff9d2a1e53a3db31958edd22768163b5a6f54c8a4d602fb5faab13f?d=identicon)[Spea](/maintainers/Spea)

---

Top Contributors

[![dbu](https://avatars.githubusercontent.com/u/76576?v=4)](https://github.com/dbu "dbu (28 commits)")[![Spea](https://avatars.githubusercontent.com/u/495017?v=4)](https://github.com/Spea "Spea (10 commits)")[![thePanz](https://avatars.githubusercontent.com/u/226021?v=4)](https://github.com/thePanz "thePanz (6 commits)")[![Tobion](https://avatars.githubusercontent.com/u/610090?v=4)](https://github.com/Tobion "Tobion (6 commits)")[![mgbmrjnppv](https://avatars.githubusercontent.com/u/122266179?v=4)](https://github.com/mgbmrjnppv "mgbmrjnppv (1 commits)")[![ChristianRiesen](https://avatars.githubusercontent.com/u/1446701?v=4)](https://github.com/ChristianRiesen "ChristianRiesen (1 commits)")[![brutal-factories](https://avatars.githubusercontent.com/u/143793262?v=4)](https://github.com/brutal-factories "brutal-factories (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rebuy-serializer-jms-adapter/health.svg)

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

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M195](/packages/sulu-sulu)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[wikimedia/parsoid

Parsoid, a bidirectional parser between wikitext and HTML5

182545.9k2](/packages/wikimedia-parsoid)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[api-platform/metadata

API Resource-oriented metadata attributes and factories

244.5M180](/packages/api-platform-metadata)[symfony/json-streamer

Provides powerful methods to read/write data structures from/into JSON streams.

15569.5k27](/packages/symfony-json-streamer)

PHPackages © 2026

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