TplBlock/vendor/herrera-io/json
2018-03-26 21:57:35 +02:00
..
src permit fun with spaces 2018-03-26 21:57:35 +02:00
.gitignore permit fun with spaces 2018-03-26 21:57:35 +02:00
.travis.yml permit fun with spaces 2018-03-26 21:57:35 +02:00
composer.json permit fun with spaces 2018-03-26 21:57:35 +02:00
LICENSE permit fun with spaces 2018-03-26 21:57:35 +02:00
phpunit.xml.dist permit fun with spaces 2018-03-26 21:57:35 +02:00
README.md permit fun with spaces 2018-03-26 21:57:35 +02:00

JSON

Build Status

A library for simplifying JSON linting and validation.

Summary

Uses the justinrainbow/json-schema and seld/jsonlint libraries to lint and validate JSON data. Also decodes JSON data as to only lint when an error is encountered, minimizing performance impact.

Installation

Add it to your list of Composer dependencies:

$ composer require herrera-io/json=1.*

Usage

<?php

use Herrera\Json\Json;

$json = new Json();

$json->validate($schema, $decoded); // throws Herrera\Json\Exception\JsonException

$data = $json->decode('{'); // throws Seld\JsonLint\ParsingException