PHPackages                             scato/serializer - 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. scato/serializer

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

scato/serializer
================

v0.3.0(10y ago)114[2 PRs](https://github.com/scato/serializer/pulls)MITPHP

Since Jun 19Pushed 8y ago1 watchersCompare

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

READMEChangelogDependencies (9)Versions (8)Used By (0)

Serializer
==========

[](#serializer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fe2052c3df0118fd73fe20f7e0ee60be99f5ca6d28249e3b290f4188583042e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736361746f2f73657269616c697a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/scato/serializer)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/7fb4612b63b24f76739d77a8f8693a6d07210715259934fac8d31be578fc4757/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f736361746f2f73657269616c697a65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/scato/serializer)

An alternative serializer that minimizes configuration, and is focused on DTOs instead of Entities.

Install
-------

[](#install)

Via Composer

```
$ composer require scato/serializer
```

Usage
-----

[](#usage)

```
$serializer = SerializerFacade::create();
$string = $serializer->serialize(..., 'json');
```

Read [the docs](doc/Usage.md) for more examples on how to use the serializer, or jump to [Advanced Usage](doc/AdvancedUsage.md) to learn about custom type handling and custom factories.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Known issues
------------

[](#known-issues)

Composite types are not supported. If your type reads `array|Foo[]` or `string|null`, you're out of luck.

Deserialization does not support polymorphism. If a type says `Foo`, an object will never be deserialized as a subclass of `Foo`. The reason for this is that DocBlocks have no way to define discriminators. (Maybe we could use the `@uses`tag to point to a property with a default value, so the property/value-pair can be used as a discriminator.)

No caching is performed, which makes deserialization relatively slow.

There is a problem with the `phpdocumentor/reflection-common` component, so you have to add it to your own `composer.json`:

```
  "require": {
    "phpdocumentor/reflection-common": "^1.0@dev"
  }
```

Credits
-------

[](#credits)

- [Scato Eggen](https://github.com/scato)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~33 days

Total

4

Last Release

3880d ago

### Community

Maintainers

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

---

Top Contributors

[![scato](https://avatars.githubusercontent.com/u/207346?v=4)](https://github.com/scato "scato (113 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/scato-serializer/health.svg)

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

###  Alternatives

[phpdocumentor/reflection-docblock

With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.

9.4k722.2M1.2k](/packages/phpdocumentor-reflection-docblock)[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k63.6M233](/packages/nelmio-api-doc-bundle)[symfony/serializer-pack

A pack for the Symfony serializer

1.1k28.2M221](/packages/symfony-serializer-pack)[humbug/box

Fast, zero config application bundler with PHARs.

1.3k801.5k69](/packages/humbug-box)[thecodingmachine/graphqlite

Write your GraphQL queries in simple to write controllers (using webonyx/graphql-php).

5723.1M30](/packages/thecodingmachine-graphqlite)[jolicode/automapper

JoliCode AutoMapper

213439.4k7](/packages/jolicode-automapper)

PHPackages © 2026

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