Code Monkey home page Code Monkey logo

ivory-serializer's Introduction

README

Travis Build Status AppVeyor Build status Code Coverage Scrutinizer Code Quality Dependency Status

Latest Stable Version Latest Unstable Version Total Downloads License

Overview

The Ivory Serializer is a PHP 5.6+ 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.

ivory-serializer's People

Contributors

alexandrepavy avatar gelolabs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.