PHPackages                             jdesrosiers/silex-jms-serializer-provider - 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. jdesrosiers/silex-jms-serializer-provider

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

jdesrosiers/silex-jms-serializer-provider
=========================================

A silex service provider that integrates jms/serializer into silex

v1.1.0(9y ago)11126.3k↓32.1%72MITPHPCI failing

Since Feb 21Pushed 6y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (3)Versions (7)Used By (2)

silex-jms-serializer-provider
=============================

[](#silex-jms-serializer-provider)

[![Build Status](https://camo.githubusercontent.com/7ae689e8f73025d7a9d1494afedb4aa43fa8c6243ad1a0ba88ad74e1734ac750/68747470733a2f2f7472617669732d63692e6f72672f6a646573726f73696572732f73696c65782d6a6d732d73657269616c697a65722d70726f76696465722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/jdesrosiers/silex-jms-serializer-provider)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e1b0e628ebb8ad8631bc430e375f46e5d33f43da29cfe68a03f0f6bc024a5ddd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a646573726f73696572732f73696c65782d6a6d732d73657269616c697a65722d70726f76696465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jdesrosiers/silex-jms-serializer-provider/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/46a049576548a70eff4fbd22c1721a06bc2d8e6c46e0f6b13643ae4bf0a15126/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a646573726f73696572732f73696c65782d6a6d732d73657269616c697a65722d70726f76696465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jdesrosiers/silex-jms-serializer-provider/?branch=master)

[silex-jms-serializer-provider](https://github.com/jdesrosiers/silex-jms-serializer-provider) is a silex service provider that integrates [JmsSerializer](https://github.com/schmittjoh/serializer) into [silex](https://github.com/fabpot/Silex).

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

[](#installation)

Install the silex-jms-serializer-provider using [composer](http://getcomposer.org/). This project uses [sematic versioning](http://semver.org/).

```
{
    "require": {
        "jdesrosiers/silex-jms-serializer-provider": "~1.0"
    }
}
```

Parameters
----------

[](#parameters)

- **serializer.srcDir**: (string) The path to the jms/serializer component.
- **serializer.annotationReader**: (AnnotationReader) Set a custom AnnotationReader.
- **serializer.cacheDir**: (string) Set a directory for caching annotations.
- **serializer.configureHandlers**: (Closure) Override the default handlers.
- **serializer.configureListeners**: (Closure) Override the default listeners.
- **serializer.objectConstructor**: (ObjectConstructorInterface) Set a custom ObjectConstructor.
- **serializer.namingStrategy**: (string) Set the PropertyNamingStrategy
- **serializer.namingStrategy.separator**: (string) If CamelCase is chosen as the NamingStrategy, you can override the default separator.
- **serializer.namingStrategy.lowerCase**: (boolean) If CamelCase is chosen as the NamingStrategy, you can override the lowerCase option.
- **serializer.serializationVisitors**: (array&lt;string:VisitorInterface&gt;) Override the default serialization visitors.
- **serializer.deserializationVisitors**: (array&lt;string:VisitorInterface&gt;) Override the default deserialization visitors.
- **serializer.includeInterfaceMetadata**: (boolean) Whether to include the metadata from the interfaces
- **serializer.metadataDirs**: (arraystring:string) Sets a map of namespace prefixes to directories.

Services
--------

[](#services)

- **serializer**: A Serializer object constructed with all of parameters given.
- **serializer.builder**: If all of the shortcuts provided are not sufficient, you can always get the SerializerBuilder object and add additional customizations before the Serializer object is constructed.
- **serializer.propertyNamingStrategy**: The PropertyNamingStrategy object that is generated by the provider. You shouldn't need to use it unless you are doing something fancy with the builder.

Registering
-----------

[](#registering)

```
$app->register(new JDesrosiers\Silex\Provider\JmsSerializerServiceProvider(), array(
    "serializer.srcDir" => __DIR__ . "/vendor/jms/serializer/src",
));
```

Usage
-----

[](#usage)

The Serializer documentation can be found at .

```
$app->get("/foo", function () use ($app) {
    $foo = new Foo();
    return $app["serializer"]->serialize($foo, "json");
});
```

Using the Builder
-----------------

[](#using-the-builder)

You can use the builder directly to add additional customizations

```
$app->register(new JDesrosiers\Silex\Provider\JmsSerializerServiceProvider(), array(
    "serializer.srcDir" => __DIR__ . "/vendor/jms/serializer/src",
//    "serializer.namingStrategy" => "IdenticalProperty",
));
$app["serializer.builder"]->setPropertyNamingStrategy(new IdenticalPropertyNamingStrategy());
```

Adding Custom Handlers
----------------------

[](#adding-custom-handlers)

```
$closure = Pimple::protect(
    function(JMS\Serializer\Handler\HandlerRegistry $registry) {
        $registry->registerHandler('serialization', 'MyObject', 'json',
            function($visitor, MyObject $obj, array $type) {
                return $obj->getName();
            }
        );
    }
);
$app->register(new JDesrosiers\Silex\Provider\JmsSerializerServiceProvider(), array(
    "serializer.srcDir" => __DIR__ . "/vendor/jms/serializer/src",
    "serializer.configureHandlers" => $closure,
));
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% 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 ~175 days

Recently: every ~144 days

Total

6

Last Release

3590d ago

Major Versions

v0.1.1 → v1.0.02016-06-06

### Community

Maintainers

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

---

Top Contributors

[![jdesrosiers](https://avatars.githubusercontent.com/u/716571?v=4)](https://github.com/jdesrosiers "jdesrosiers (16 commits)")[![ReservedDeveloper](https://avatars.githubusercontent.com/u/6430108?v=4)](https://github.com/ReservedDeveloper "ReservedDeveloper (2 commits)")

---

Tags

serializerserviceproviderjmssilexJmsSerializer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jdesrosiers-silex-jms-serializer-provider/health.svg)

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

###  Alternatives

[goetas-webservices/xsd2php-runtime

Convert XSD (XML Schema) definitions into PHP classes

4910.9M36](/packages/goetas-webservices-xsd2php-runtime)[goetas-webservices/xsd2php

Convert XSD (XML Schema) definitions into PHP classes and JMS metadata

2411.6M37](/packages/goetas-webservices-xsd2php)[m1/vars

Vars is a simple to use and easily extendable configuration loader with in built loaders for ini, json, PHP, toml, XML and yaml/yml file types. It also comes with in built support for Silex and more frameworks to come soon.

69124.2k1](/packages/m1-vars)[jdesrosiers/silex-cors-provider

A silex service provider that adds CORS services to silex

83892.3k10](/packages/jdesrosiers-silex-cors-provider)[ddesrosiers/silex-annotation-provider

A silex service provider that allows the use of annotations in ServiceControllers.

25246.7k3](/packages/ddesrosiers-silex-annotation-provider)[goetas/xsd2php-runtime

Convert XSD (XML Schema) definitions into PHP classes

493.3k](/packages/goetas-xsd2php-runtime)

PHPackages © 2026

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