innmind/json

Type safe json encoder/decoder

1.4.0 2024-03-23 14:35 UTC

This package is auto-updated.

Last update: 2024-04-23 14:46:21 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)