Download the PHP package xenolope/cartographer without Composer
On this page you can find all versions of the php package xenolope/cartographer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xenolope/cartographer
More information about xenolope/cartographer
Files in xenolope/cartographer
Package cartographer
Short Description A super-simple library to map JSON documents to objects, similar to Java's Jackson
License MIT
Informations about the package cartographer
Cartographer
Cartographer is a super-simple library for deserializing JSON into POPOs, similar to FasterXML's jackson-databind
package for Java.
Installation
The library can be installed with Composer, by including the following in your composer.json
:
Usage
POPOs
Your POPOs must have a property and corresponding setter, with either the property having a @var ClassName
docblock, or the setter having a type hint.
Setters are called directly, and properties are never touched, even if they're declared public
(though this might be added in a later version).
Simple values are converted to the types given in their @var
docblocks (using settype()
), objects are created based on the class specified in the @var
docblocks, and arrays of objects are also created, and can be specified with the @var ClassName[]
notation.
Mapping
Roadmap
- Add custom property mapping, for when JSON properties don't match with POPO properties
- Maybe add in support for serializing a POPO to JSON
Thanks
This library was inspired by:
fasterxml/jackson-databind
for Javanetresearch/jsonmapper
for PHP
License
Cartographer is released under the MIT License; please see LICENSE for more information.