Type safe json encode/decoder, the goal is to not leave errors unchecked.
composer require innmind/json
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)