innmind/json

Type safe json encoder/decoder

Installs: 270 434

Dependents: 15

Suggesters: 0

Security: 0

Stars: 9

Watchers: 1

Forks: 2

pkg:composer/innmind/json

1.5.0 2026-02-08 13:55 UTC

This package is auto-updated.

Last update: 2026-02-08 13:56:31 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)