2017 © Pedro Peláez
 

library exceptional-json

JSON encoding and decoding that throws exceptions on failure

image

daverandom/exceptional-json

JSON encoding and decoding that throws exceptions on failure

  • Friday, June 15, 2018
  • by DaveRandom
  • Repository
  • 2 Watchers
  • 18 Stars
  • 19,961 Installations
  • PHP
  • 12 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 6 Versions
  • 22 % Grown

The README.md

Exceptional JSON

Build Status Scrutinizer Code Quality Code Coverage Packagist License, (*1)

Thin wrapper around PHP's json_encode() and json_decode() functions, which throws exceptions when an operation fails., (*2)

Required PHP Version

  • PHP 7.0+

Installation

$ composer require daverandom/exceptional-json

Usage

Call the \ExceptionJSON\encode() and \ExceptionJSON\decode() functions in exactly the same way as you would with json_encode() and json_decode(). The only difference is that they will throw an exception if the operation fails., (*3)

Also defines json_try_encode() and json_try_decode() in the root namespace if they don't already exist, these are simply aliases of their namespaced counterparts., (*4)

$encoded = \ExceptionJSON\encode($data);
$decoded = \ExceptionJSON\decode($encoded);

The Versions

15/06 2018

dev-master

9999999-dev

JSON encoding and decoding that throws exceptions on failure

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

11/06 2018

v1.0.4

1.0.4.0

JSON encoding and decoding that throws exceptions on failure

  Sources   Download

MIT

The Requires

  • php >=7.0

 

31/05 2017

v1.0.3

1.0.3.0

JSON encoding and decoding that throws exceptions on failure

  Sources   Download

MIT

31/05 2017

v1.0.2

1.0.2.0

JSON encoding and decoding that throws exceptions on failure

  Sources   Download

MIT

04/05 2016

v1.0.1

1.0.1.0

JSON encoding and decoding that throws exceptions on failure

  Sources   Download

MIT

04/05 2016

v1.0.0

1.0.0.0

JSON encoding and decoding that throws exceptions on failure

  Sources   Download

MIT