midhundevasia / json-ast
JSON to AST parser in PHP
0.0.1
2021-04-25 21:56 UTC
Requires
- php: >=7.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.19@dev
- phpunit/phpunit: ^8
- squizlabs/php_codesniffer: ^3.0@dev
This package is auto-updated.
Last update: 2024-09-29 05:56:30 UTC
README
Install
$ composer require midhundevasia/json-ast
Usage
<?php
use JsonAst\Parser;
$parser = new Parser();
$parser->parse(
'{"hello" : "World"}',
['loc' => true, 'source' => null]
);
Tests
$ ./vendor/bin/phpunit --testdox tests
Todo
- write more test cases
- code coverage
License
json-ast is licensed under GNU General Public License (GPLv3) - see the LICENSE
file for details.
Credits
Inspired from following repositories.
https://github.com/vtrushin/json-to-ast
https://github.com/vtrushin/code-error-fragment
Development
$ vendor/bin/phpcbf src
$ vendor/bin/php-cs-fixer fix src