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

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

tsantos/serializer
==================

Object (de)serializer component for PHP

v4.0.2(7y ago)281.7k11MITPHPPHP ^7.1

Since Nov 21Pushed 6y ago4 watchersCompare

[ Source](https://github.com/tsantos84/serializer)[ Packagist](https://packagist.org/packages/tsantos/serializer)[ RSS](/packages/tsantos-serializer/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (6)Dependencies (11)Versions (12)Used By (1)

TSantos Serializer
==================

[](#tsantos-serializer)

[![Build Status](https://camo.githubusercontent.com/9b3c45cc30e9177da8883f2b39c61282755a34aa225b2de68ab9a2e95d381315/68747470733a2f2f7472617669732d63692e6f72672f7473616e746f7338342f73657269616c697a65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tsantos84/serializer) [![Quality Gate Status](https://camo.githubusercontent.com/f609ecce8c1a2a1ff43efa21f6f056609404cfee485f7f094c234f57c804a8e6/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d7473616e746f7338345f73657269616c697a6572266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=tsantos84_serializer) [![Coverage](https://camo.githubusercontent.com/d07066b0755b69f2ea9cb943b6072910134fca8b1047486a1e2f8fe1ec47961a/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d7473616e746f7338345f73657269616c697a6572266d65747269633d636f766572616765)](https://sonarcloud.io/dashboard?id=tsantos84_serializer) [![Latest Stable Version](https://camo.githubusercontent.com/7402fb8b23be4c870d9478d082163b4dd4964b5625ad624149ba7e6171c53934/68747470733a2f2f706f7365722e707567782e6f72672f7473616e746f732f73657269616c697a65722f76657273696f6e)](https://packagist.org/packages/tsantos/serializer) [![Total Downloads](https://camo.githubusercontent.com/287aee3bd93ab333cab4b5c64717f015c07b9dc7daec96a32200f0fa20aae786/68747470733a2f2f706f7365722e707567782e6f72672f7473616e746f732f73657269616c697a65722f646f776e6c6f616473)](https://packagist.org/packages/tsantos/serializer) [![Latest Unstable Version](https://camo.githubusercontent.com/d0b2f01a9033f14fcc6eea6f11739e673de0d99d7c9bb15f8d939eaac52657e2/68747470733a2f2f706f7365722e707567782e6f72672f7473616e746f732f73657269616c697a65722f762f756e737461626c65)](//packagist.org/packages/tsantos/serializer) [![License](https://camo.githubusercontent.com/29073f20c8ef201c0b255a8ae5147ccb08476c1f9901f7a778f9a8d72bf35329/68747470733a2f2f706f7365722e707567782e6f72672f7473616e746f732f73657269616c697a65722f6c6963656e7365)](https://packagist.org/packages/tsantos/serializer) [![composer.lock available](https://camo.githubusercontent.com/b8c388eea3d1e1cfb6da0db2633811fe5d6d1e041bc2fa57fa1e8cbd4d80b05d/68747470733a2f2f706f7365722e707567782e6f72672f7473616e746f732f73657269616c697a65722f636f6d706f7365726c6f636b)](https://packagist.org/packages/tsantos/serializer)

TSantos Serializer is a library to encode/decode PHP objects to some string representation. Because of its exclusive serialization strategy, this library is the [faster serialization component](https://github.com/tsantos84/serializer-benchmark) to PHP.

Instalation
-----------

[](#instalation)

You can install this library through composer:

`composer require tsantos/serializer`

or just add `tsantos/serializer` to your composer file and then

`composer update`

Usage
-----

[](#usage)

The best way to get start with `TSantos Serializer` is by using the builder. With a few configurations you are ready to serialize your data:

```
use TSantos\Serializer\SerializerBuilder;

class Post {
    public $title;
    public $summary;
}

$serializer = (new SerializerBuilder())
    ->setHydratorDir('/path/to/generated/hydrators')
    ->build();

$person = new Post('Post title', 'Post summary');

echo $serializer->serialize($person); // {"title":"Post title", "summary":"Post summary"}
```

This is the simplest example to get you started with TSantos Serializer. There are a lot of capabilities which you should know in order to master your serializer instance and take advantage of all library's power.

Features
--------

[](#features)

Main features currently supported by TSantos Serializer:

- No need to mapping classes for simple use cases ...
- ... but supports `YAML`, `XML` and `Annotations` mapping formats for advanced mapping
- Supports `JSON` encoders
- (De-)serializes objects of any depth
- Virtual properties
- Properties grouping
- Event listeners to hook into serialization operations
- (De-)serializes interfaces and abstract classes

Documentation
-------------

[](#documentation)

Please refer to the [documentation page](https://tsantos-serializer.readthedocs.io) to see all allowed configurations.

Licence
-------

[](#licence)

MIT

Tests
-----

[](#tests)

`vendor/bin/phpunit -c phpunit.xml.dist`

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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 ~48 days

Recently: every ~56 days

Total

9

Last Release

2761d ago

Major Versions

1.1.1 → 2.0.02017-12-23

2.1.0 → v3.0.02018-07-05

v3.0.0 → v4.0.02018-11-11

### Community

Maintainers

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

---

Top Contributors

[![tsantos84](https://avatars.githubusercontent.com/u/1040915?v=4)](https://github.com/tsantos84 "tsantos84 (312 commits)")

---

Tags

data-transformationphp-libraryphp7serialization-libraryserializermetadatadata transformation

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[oro/platform

Business Application Platform (BAP)

645143.5k114](/packages/oro-platform)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M504](/packages/pimcore-pimcore)[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[typo3/cms-extbase

TYPO3 CMS Extbase - Extension framework to create TYPO3 frontend plugins and TYPO3 backend modules.

1813.1M787](/packages/typo3-cms-extbase)

PHPackages © 2026

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