Download the PHP package brettminnie/breakfast-serializer without Composer
On this page you can find all versions of the php package brettminnie/breakfast-serializer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download brettminnie/breakfast-serializer
More information about brettminnie/breakfast-serializer
Files in brettminnie/breakfast-serializer
Package breakfast-serializer
Short Description Library for (de-)serializing data of any complexity to JSON
License MIT
Informations about the package breakfast-serializer
breakfast-serializer
A replacement for the other well known serializer, initially we were aiming for backwards compatibility, however it seemed more appropriate to develop a lightweight alternative. We are forgoing the depth of features now to offer something that is easy to configure and works well without any configuration.
Installation
$ composer require brettminnie/breakfast-serializer:0.1.*
Job done, start enjoying your morning serial!
Configuration
Out the box will do a full depth/breadth recursion and serialize to JSON format, no config is required. It will always
serialize with a variable called className
attached to the object. This is a fully fledged namespace and is required
to deserialize. If you want to deserialize from JSON data that is missing this variable it needs to be injected into the
object.
Supported Serialization Formats
- [x] JSON
- [ ] XML
- [ ] PHP Object Notation
- [ ] YAML
Features
- [x] Simple limiting of traversal depth
- [x] Mapping of properties to alternate names and back again
- [x] Excluding of properties from serialization and ignoring them on deserialization
- [x] Simple YAML config format (Yay no slow php annotations!)
Quick and Dirty Example
Further examples in the documentation directory.