PHPackages                             gitnik/jms-typed-properties-driver - 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. gitnik/jms-typed-properties-driver

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

gitnik/jms-typed-properties-driver
==================================

Allows you to use typed properties for JMS serialization

0.0.1(6y ago)36.7k2[1 PRs](https://github.com/gitnik/jms-typed-properties-driver/pulls)MITPHPPHP &gt;=7.4CI failing

Since Jan 6Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/gitnik/jms-typed-properties-driver)[ Packagist](https://packagist.org/packages/gitnik/jms-typed-properties-driver)[ RSS](/packages/gitnik-jms-typed-properties-driver/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Warning
-------

[](#warning)

**Do not use this in a production environment. While the base cases work, I am sure there are plenty of untested edge-cases**

Usage
-----

[](#usage)

#### Deserialization:

[](#deserialization)

```
class Make {
    private string $name;
}

class Car {
    private string $color;
    private Make $make;
}

$inputData = [
    'color' => 'red',
    'make' => [
        'name' => 'Tesla'
    ]
];

$serializer = SerializerBuilder::create()
    ->setMetadataDriverFactory(new TypedPropertiesDriverFactory())
    ->build();

$car = $serializer->deserialize(
   json_encode($inputData),
   Car::class,
   'json'

// interact with your Car object

);
```

#### Serialization:

[](#serialization)

```
class Make {
    public string $name;
}

class Car {
    public string $color;
    public Make $make;
}

$make = new Make();
$make->name = 'Tesla';

$car = new Car();
$car->make = $make;
$car->color = 'red';

$serializer = SerializerBuilder::create()
    ->setMetadataDriverFactory(new TypedPropertiesDriverFactory())
    ->build();

$json = $serializer->serialize(
   $car,
   'json'

/*
{
    "color": "red",
    "make": {
        "name": "Tesla"
    }
}
*/
);
```

How it works
------------

[](#how-it-works)

JMS/Serializer has the concept of drivers, which are used to gather configuration information about an object it wants to (de)serialize. An example of this would be the Annotation driver, which reads configuration via annotations.

What this library does is, wrap whatever driver is currently being used and enhance the information acquired by the "default" driver with type information gathered via reflection.

This means you can gradually migrate towards type-hinted properties on a property-by-property basis and also mix different ways of configuration, like so:

```
class Car {
    /**
     * @SerializedName("colour")
     */
    private string $color;
}
```

Limitations:
------------

[](#limitations)

1. While it can handle null values for (de)serialization, you are not allowed to omit properties during deserialization that have been typed-hinted, as those must always be initialized before they can be accessed
2. There has been a long-standing issue with the parent library regarding coercing values instead of type-checking them ([schmittjoh/serializer#561](https://github.com/schmittjoh/serializer/issues/561)). This library has no influence on this behaviour

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance49

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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

Unknown

Total

1

Last Release

2370d ago

### Community

Maintainers

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

---

Top Contributors

[![gitnik](https://avatars.githubusercontent.com/u/996623?v=4)](https://github.com/gitnik "gitnik (5 commits)")[![chrisyoungbrighte](https://avatars.githubusercontent.com/u/128448021?v=4)](https://github.com/chrisyoungbrighte "chrisyoungbrighte (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gitnik-jms-typed-properties-driver/health.svg)

```
[![Health](https://phpackages.com/badges/gitnik-jms-typed-properties-driver/health.svg)](https://phpackages.com/packages/gitnik-jms-typed-properties-driver)
```

###  Alternatives

[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k92.4M680](/packages/jms-serializer-bundle)[sulu/sulu

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

1.3k1.4M203](/packages/sulu-sulu)[goetas-webservices/xsd2php-runtime

Convert XSD (XML Schema) definitions into PHP classes

4912.6M43](/packages/goetas-webservices-xsd2php-runtime)[easybill/zugferd-php

ZUGFeRD PHP SDK (Factur-X, XRechnung) - Convert PHP Objects to XML and back.

101328.4k11](/packages/easybill-zugferd-php)[friendsofcxml/cxml-php

PHP Implementation of cXML Standard

17155.6k9](/packages/friendsofcxml-cxml-php)[dagger/dagger

Dagger PHP SDK

261.1k](/packages/dagger-dagger)

PHPackages © 2026

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