Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

De-Serialization library supporting CSV, JSON, XML & YAML for PHP 7.0+

License

Notifications You must be signed in to change notification settings

bresam/ivory-serializer

 
 

Repository files navigation

README

Travis Build Status Code Coverage Scrutinizer Code Quality

Overview

The Ivory Serializer is a PHP ^7.0 library allowing you to (de)-serialize complex data using the visitor pattern recursively on each node of the graph. It supports the CSV, JSON, XML and YAML formats. It also supports features such as exclusion strategies (groups, max depth, circular reference, version, ...), naming strategies (camel case, snake case, studly caps), automatic/explicit mapping (reflection, annotation, XML, YAML, JSON) and many others...

use Ivory\Serializer\Format;
use Ivory\Serializer\Serializer;

$stdClass = new \stdClass();
$stdClass->foo = true;
$stdClass->bar = ['foo', [123, 432.1]];

$serializer = new Serializer();

echo $serializer->serialize($stdClass, Format::JSON);
// {"foo": true,"bar": ["foo", [123, 432.1]]}

$deserialize = $serializer->deserialize($json, \stdClass::class, Format::JSON);
// $deserialize == $stdClass

Documentation

Testing

The library is fully unit tested by PHPUnit with a code coverage close to 100%. To execute the test suite, check the travis configuration.

Contribute

We love contributors! Ivory is an open source project. If you'd like to contribute, feel free to propose a PR! You can follow the CONTRIBUTING file which will explain you how to set up the project.

License

The Ivory Serializer is under the MIT license. For the full copyright and license information, please read the LICENSE file that was distributed with this source code.

About

De-Serialization library supporting CSV, JSON, XML & YAML for PHP 7.0+

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.6%
  • Other 0.4%