daverandom/exceptional-json
最新稳定版本:v1.0.4
Composer 安装命令:
composer require daverandom/exceptional-json
包简介
JSON encoding and decoding that throws exceptions on failure
README 文档
README
Thin wrapper around PHP's json_encode() and json_decode() functions, which throws exceptions when an operation fails.
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.
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.
$encoded = \ExceptionJSON\encode($data); $decoded = \ExceptionJSON\decode($encoded);
统计信息
- 总下载量: 1.4M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 32
- 点击次数: 1
- 依赖项目数: 15
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-04