Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JSON linter
<?php
<<<CONFIG
packages:
- "seld/jsonlint: 1.3.1"
CONFIG;
use Seld\JsonLint\JsonParser;
$parser = new JsonParser();
$json = file_get_contents($argv[1]);
$result = $parser->lint($json);
if (null === $result) {
return 0;
}
echo $result->getMessage();
return 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.