2017 © Pedro PelĂĄez
 

library json

Wrap JSON encoding/decoding errors in exception

image

eastwest/json

Wrap JSON encoding/decoding errors in exception

  • Wednesday, June 20, 2018
  • by eastwest
  • Repository
  • 2 Watchers
  • 44 Stars
  • 137 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 6 Versions
  • 6750 % Grown

The README.md

Wrap JSON encoding/decoding errors in exception

Catch json_encode() and json_decode() errors without executing json_last_error(). In PHP 7.3 these functions will throw an exception., (*1)


use Eastwest\Json\Json; use Eastwest\Json\JsonException; try { $json = Json::encode(['key' => 'value']); } catch (JsonException $e) { // code and message will match json_last_error() values: // @link http://php.net/manual/en/function.json-last-error.php#refsect1-function.json-last-error-returnvalues echo $e->getMessage(); echo $e->getCode(); }

Installation

You'll have to follow a couple of simple steps to install this package., (*2)

Downloading

Via composer:, (*3)

$ composer require eastwest/json:^3.0

Or add the package to your development dependencies in composer.json and run composer update eastwest/json to download the package:, (*4)

{
    "require": {
        "eastwest/json": "^3.0"
    }
}

If you need a way to deploy files or manage your Laravel Forge servers. Take a look at GitFTP-Deploy or F-Bar, (*5)

The Versions

20/06 2018

dev-master

9999999-dev

Wrap JSON encoding/decoding errors in exception

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Jan Östlund

14/06 2018

v3.0.1

3.0.1.0

Wrap JSON encoding/decoding errors in exception

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Jan Östlund

14/06 2018

v3.0

3.0.0.0

  Sources   Download

The Requires

  • php >=7.0

 

The Development Requires

by Jan Östlund

10/05 2018

v2.0.1

2.0.1.0

  Sources   Download

The Development Requires

by Jan Östlund

10/05 2018

dev-add-license-1

dev-add-license-1

  Sources   Download

The Development Requires

by Jan Östlund

10/05 2018

v2.0

2.0.0.0

  Sources   Download

The Development Requires

by Jan Östlund