qlimix/encoding-json

Encoding & decoding array's to string and vice versa

2.0.0 2020-04-12 10:23 UTC

This package is auto-updated.

Last update: 2024-10-12 20:17:32 UTC


README

Travis CI Coveralls Packagist MIT License

Encode and decode json based on the qlimix/encoding package.

Install

Using Composer:

$ composer require qlimix/encoding-json

usage

<?php

use Qlimix/Encoding/Encode/JsonEncode;
use Qlimix/Encoding/Decode/JsonDecode;

$encode = new JsonEncode();
$decode = new JsonDecode();

$value = ['foo' => 'bar', 'number' => 1];

$encoded = $encode->encode($value);
$decode = $decode->decode($encoded);

Testing

To run all unit tests locally with PHPUnit:

$ vendor/bin/phpunit

Quality

To ensure code quality run grumphp which will run all tools:

$ vendor/bin/grumphp run

Contributing

Please see CONTRIBUTING for details.