swaggest/json

JSON encoder with RAW support

v1.0.0 2017-11-23 05:51 UTC

This package is auto-updated.

Last update: 2024-03-18 00:57:42 UTC


README

JSON encoder with RAW support

Build Status Scrutinizer Code Quality Code Climate

Installation

composer require swaggest/json

Usage

$data = array(
    'val' => 'hello!',
    'callback' => new \Swaggest\Json\RawJson('function(){alert("hello!")}')
);

$json = (string)(new \Swaggest\Json\Json($data));
$this->assertSame('{"val":"hello!","callback":function(){alert(\"hello!\")}}', $json);