innmind/json

Type safe json encoder/decoder

1.3.0 2021-01-10 10:53 UTC

This package is auto-updated.

Last update: 2022-06-10 13:59:05 UTC


README

Build Status codecov Type Coverage

Type safe json encode/decoder, the goal is to not leave errors unchecked.

Installation

composer require innmind/json

Usage

use Innmind\Json\Json;

Json::encode(['foo' => 'bar']); // {"foo":"bar"}
Json::decode('{"foo":"bar"}'); // ['foo' => 'bar']
Json::decode('{]'); // will throw an exception (instead of returning false)