Awesome Open Source
Awesome Open Source

TSantos Serializer

Build Status Quality Gate Status Coverage Latest Stable Version Total Downloads Latest Unstable Version License composer.lock available

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 to PHP.


You can install this library through composer:

composer require tsantos/serializer

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

composer update


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())

$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.


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


Please refer to the documentation page to see all allowed configurations.




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

Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Php (285,841
Mapping (7,891
Serialization Library (264
Data Transformation (170