qlimix/encoding-json

编码和解码数组到字符串以及相反操作

2.0.0 2020-04-12 10:23 UTC

This package is auto-updated.

Last update: 2024-09-12 19:59:15 UTC


README

Travis CI Coveralls Packagist MIT License

基于 qlimix/encoding 包进行 JSON 编码和解码。

安装

使用 Composer

$ composer require qlimix/encoding-json

用法

<?php

use Qlimix/Encoding/Encode/JsonEncode;
use Qlimix/Encoding/Decode/JsonDecode;

$encode = new JsonEncode();
$decode = new JsonDecode();

$value = ['foo' => 'bar', 'number' => 1];

$encoded = $encode->encode($value);
$decode = $decode->decode($encoded);

测试

要使用 PHPUnit 在本地运行所有单元测试

$ vendor/bin/phpunit

质量

为了确保代码质量,运行 grumphp,它将运行所有工具

$ vendor/bin/grumphp run

贡献

有关详细信息,请参阅 CONTRIBUTING