scato/serializer

v0.3.0 2015-10-03 20:22 UTC

README

Latest Version on Packagist Software License Build Status

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

Install

Via Composer

$ composer require scato/serializer

Usage

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

Read the docs for more examples on how to use the serializer, or jump to Advanced Usage to learn about custom type handling and custom factories.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

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

License

The MIT License (MIT). Please see License File for more information.