PHPackages                             chimera/serialization-jms - 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. chimera/serialization-jms

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

chimera/serialization-jms
=========================

Adapter for jms/serializer which allows you to create messages to be handled

0.4.0(5y ago)0107.7k↓38.2%1[9 PRs](https://github.com/chimeraphp/serialization-jms/pulls)1MITPHPPHP ^7.4 || ^8.0

Since May 6Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/chimeraphp/serialization-jms)[ Packagist](https://packagist.org/packages/chimera/serialization-jms)[ GitHub Sponsors](https://github.com/lcobucci)[ Patreon](https://www.patreon.com/lcobucci)[ RSS](/packages/chimera-serialization-jms/feed)WikiDiscussions 1.0.x Synced 1mo ago

READMEChangelog (4)Dependencies (11)Versions (19)Used By (1)

Chimera - serialization-jms
===========================

[](#chimera---serialization-jms)

[![Total Downloads](https://camo.githubusercontent.com/cee4a97795e340ea9a901ac12a46e679cde92368daa864fb979e7a5066f08e0d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6368696d6572612f73657269616c697a6174696f6e2d6a6d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chimera/serialization-jms)[![Latest Stable Version](https://camo.githubusercontent.com/bd21ea79790954dde30bfe8a4580be63e8661f9b47e6840a0268cff247f61c87/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368696d6572612f73657269616c697a6174696f6e2d6a6d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chimera/serialization-jms)[![Unstable Version](https://camo.githubusercontent.com/3791cbd360572a4bb98464f154960c4d83a5b32b10b6d0faf3ee8659d34a3c0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f6368696d6572612f73657269616c697a6174696f6e2d6a6d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chimera/serialization-jms)

[![Build Status](https://camo.githubusercontent.com/6d082b296077afaaad354c52f03b4b199833cc807565b69164853d03bf900127/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6368696d6572617068702f73657269616c697a6174696f6e2d6a6d732f706870756e69742e796d6c3f6272616e63683d312e302e78267374796c653d666c61742d737175617265)](https://github.com/chimeraphp/serialization-jms/actions?query=workflow%3A%22PHPUnit%20Tests%22+branch%3A1.0.x)[![Code Coverage](https://camo.githubusercontent.com/2b4b5b41a2870384728c966dc27ee8cbb2a5fcd5e0451174e6531fab610b380f/68747470733a2f2f636f6465636f762e696f2f67682f6368696d6572617068702f73657269616c697a6174696f6e2d6a6d732f6272616e63682f302e352e782f67726170682f62616467652e737667)](https://codecov.io/gh/chimeraphp/serialization-jms)

> The term Chimera (*/kɪˈmɪərə/* or */kaɪˈmɪərə/*) has come to describe any mythical or fictional animal with parts taken from various animals, or to describe anything composed of very disparate parts, or perceived as wildly imaginative, implausible, or dazzling.

There are many many amazing libraries in the PHP community and with the creation and adoption of the PSRs we don't necessarily need to rely on full stack frameworks to create a complex and well designed software. Choosing which components to use and plugging them together can sometimes be a little challenging.

The goal of this set of packages is to make it easier to do that (without compromising the quality), allowing you to focus on the behaviour of your software.

This package provides an adapter for [`jms/serializer`](https://github.com/schmittjoh/serializer), allowing us to use it as a `MessageCreator` - which is responsible for converting the user input into a message to be handled.

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

[](#installation)

Package is available on [Packagist](http://packagist.org/packages/chimera/serialization-jms), you can install it using [Composer](http://getcomposer.org).

```
composer require chimera/serialization-jms
```

### PHP Configuration

[](#php-configuration)

In order to make sure that we're dealing with the correct data, we're using `assert()`, which is a very interesting feature in PHP but not often used. The nice thing about `assert()` is that we can (and should) disable it in production mode so that we don't have useless statements.

So, for production mode, we recommend you to set `zend.assertions` to `-1` in your `php.ini`. For development you should leave `zend.assertions` as `1` and set `assert.exception` to `1`, which will make PHP throw an [`AssertionError`](https://secure.php.net/manual/en/class.assertionerror.php)when things go wrong.

Check the documentation for more information:

Usage
-----

[](#usage)

This is how you can use the `ArrayTransformer` as a `MessageCreator`:

```
