ivory / json-builder
JSON builder with escaping control for PHP 7.0+
Installs: 250 762
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 28
Open Issues: 0
Requires
- php: ^7.1 || ^8.0
- ext-json: *
- symfony/property-access: ^3.0 || ^4.0 || ^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- phpunit/phpunit: ^7.0 || ^8.0 || ^9.0
- symfony/phpunit-bridge: ^3.0 || ^4.0 || ^5.0
Replaces
- egeloen/json-builder: ^3.0.0
README
The Ivory JSON builder is a PHP 7.0+ library allowing you to build your JSON through the Symfony2 PropertyAccess component while keeping the control of the value escaping.
use Ivory\JsonBuilder\JsonBuilder; $builder = new JsonBuilder(); $json = $builder ->setValues(array('foo' => array('bar'))) ->setValue('[baz]', 'bat', false) ->build(); // {"foo":["bar"],"baz":bat} echo $json;
Documentation
Testing
The library is fully unit tested by PHPUnit with a code coverage close to 100%. To execute the test suite, check the travis configuration.
Contribution
We love contributors! Ivory is an open source project. If you'd like to contribute, feel free to propose a PR! You can follow the CONTRIBUTING file which will explain you how to set up the project.
License
The Ivory JSON Builder is under the MIT license. For the full copyright and license information, please read the LICENSE file that was distributed with this source code.