scato / serializer
Requires
- phpdocumentor/reflection-common: ^1.0@dev
- phpdocumentor/reflection-docblock: ^2.0
- phpdocumentor/type-resolver: ^0.1.3@dev
Requires (Dev)
- behat/behat: ^3.0
- nelmio/alice: ^1.7
- phpmd/phpmd: ^2.2
- phpspec/phpspec: ^2.2
- phpunit/phpunit: ^4.6
- squizlabs/php_codesniffer: dev-master
This package is not auto-updated.
Last update: 2024-11-12 05:02:38 UTC
README
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.