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

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

liip/serializer-jms-adapter
===========================

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

2.2.2(1y ago)10273.5k↓45.2%2MITPHPPHP ^8.0CI passing

Since Oct 3Pushed 1y ago8 watchersCompare

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

READMEChangelog (7)Dependencies (9)Versions (8)Used By (0)

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

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

An adapter to make [liip/serializer](https://github.com/liip/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/liip/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 95% of packages

Maintenance45

Moderate activity, may be stable

Popularity42

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% 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 ~284 days

Recently: every ~234 days

Total

8

Last Release

427d 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/d10b19f74fa2f712a4fbb9d9073c95d612c0f32e6ba95aed6f68e589c8e2688e?d=identicon)[Tobion](/maintainers/Tobion)

![](https://www.gravatar.com/avatar/4a788c96bbcf89371ff0c614ad9f1655363369cb8e17ffd7afbebf046da6dad8?d=identicon)[thepanz](/maintainers/thepanz)

![](https://avatars.githubusercontent.com/u/76576?v=4)[David Buchmann](/maintainers/dbu)[@dbu](https://github.com/dbu)

![](https://www.gravatar.com/avatar/f90b3d9868621aaf99f00b4cf21156dd22ecd265bf5b5cb406f21cbd62f5a63f?d=identicon)[ChristianRiesen](/maintainers/ChristianRiesen)

![](https://www.gravatar.com/avatar/29288e00799aeecc129c437fe166003f4dd598637cef23b050eae6806b0b0bb0?d=identicon)[mjanser](/maintainers/mjanser)

![](https://www.gravatar.com/avatar/3c4c0e15d3d7112cdfd14cdf0ffc0544b956f5028b94dd2e5987978737539526?d=identicon)[bellisk](/maintainers/bellisk)

![](https://www.gravatar.com/avatar/b0c5a0a65c68d3eb575069ffca08fb7d72c32540f8ce26ac17cc29a009a30442?d=identicon)[michellesanver](/maintainers/michellesanver)

---

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 (7 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)")[![ChristianRiesen](https://avatars.githubusercontent.com/u/1446701?v=4)](https://github.com/ChristianRiesen "ChristianRiesen (1 commits)")[![mgbmrjnppv](https://avatars.githubusercontent.com/u/122266179?v=4)](https://github.com/mgbmrjnppv "mgbmrjnppv (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[wikimedia/parsoid

Parsoid, a bidirectional parser between wikitext and HTML5

171524.3k1](/packages/wikimedia-parsoid)[liip/serializer

High performance serializer that works with code generated helpers to achieve high throughput.

128365.2k4](/packages/liip-serializer)[antlr/antlr4-php-runtime

PHP 8.0+ runtime for ANTLR 4

96636.7k13](/packages/antlr-antlr4-php-runtime)[symfony/json-streamer

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

14440.0k8](/packages/symfony-json-streamer)[friendsofcxml/cxml-php

PHP Implementation of cXML Standard

16100.6k2](/packages/friendsofcxml-cxml-php)[matecat/xliff-parser

A Xliff parser written in PHP

14127.5k](/packages/matecat-xliff-parser)

PHPackages © 2026

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