boundwize/jsonrecast
JsonRecast is an editable JSON AST for PHP with visitor traversal and formatting-preserving printing. Update JSON content programmatically while keeping indentation, spacing, and key order intact, so output differs only where you made changes—ideal for composer.json and config files.
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.36...1.0.37
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.35...1.0.36
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.34...1.0.35
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.33...1.0.34
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.32...1.0.33
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.31...1.0.32
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.30...1.0.31
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.29...1.0.30
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.28...1.0.29
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.27...1.0.28
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.26...1.0.27
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.25...1.0.26
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.24...1.0.25
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.23...1.0.24
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.22...1.0.23
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.21...1.0.22
JsonSerializable by @samsonasik in https://github.com/boundwize/jsonrecast/pull/165Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.20...1.0.21
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.19...1.0.20
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.18...1.0.19
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.17...1.0.18
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.16...1.0.17
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.15...1.0.16
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.14...1.0.15
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.13...1.0.14
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.12...1.0.13
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.11...1.0.12
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.10...1.0.11
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.9...1.0.10
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.8...1.0.9
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.7...1.0.8
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.6...1.0.7
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.5...1.0.6
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.4...1.0.5
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.3...1.0.4
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.2...1.0.3
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.1...1.0.2
Full Changelog: https://github.com/boundwize/jsonrecast/compare/1.0.0...1.0.1
After 100 iterative releases, I’m proud to release JsonRecast 1.0.0, the first stable release! 🎉
Read documentation to get started https://boundwize.github.io/jsonrecast/
Enjoy! 😉
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.19...1.0.0
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.18...0.4.19
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.17...0.4.18
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.16...0.4.17
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.15...0.4.16
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.14...0.4.15
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.13...0.4.14
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.12...0.4.13
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.11...0.4.12
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.10...0.4.11
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.9...0.4.10
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.8...0.4.9
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.7...0.4.8
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.6...0.4.7
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.5...0.4.6
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.4...0.4.5
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.3...0.4.4
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.2...0.4.3
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.1...0.4.2
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.4.0...0.4.1
This release introduces NodeJsonFinder, a read-only query helper mirroring PHP-Parser's NodeFinder.
For example, use of the find:
$document = JsonRecast::parse(<<<'JSON'
{
"repositories": [
{"type": "composer", "url": "http://repo.internal.example/"},
{"type": "vcs", "url": "https://github.com/acme/lib"}
]
}
JSON);
From the $document object, you can resolve the matching nodes, eg:
$finder = new NodeJsonFinder();
$insecureNodes = $finder->find(
$document,
static fn (NodeJson $node, NodeJsonPath $path): bool =>
$node instanceof StringNode
&& str_starts_with($node->value, 'http://'),
);
// $insecureNodes:
// [
// StringNode { value: 'http://repo.internal.example/' },
// ]
You can also find with extracted nodes data: found nodes do not record their own paths, so when the report should also say where each problem is, extract it in the filter as it arrives:
$insecure = [];
$finder = new NodeJsonFinder();
$finder->find(
$document,
static function (NodeJson $node, NodeJsonPath $path) use (&$insecure): bool {
if ($node instanceof StringNode && str_starts_with($node->value, 'http://')) {
$insecure[] = [
'value' => $node->value,
'path_info' => array_map(
static fn ($segment) => $segment->value, $path->segments()
),
];
return true;
}
return false;
},
);
// $insecure:
// [
// [
// 'value' => 'http://repo.internal.example/',
// 'path_info' => ['repositories', 0, 'url'],
// ],
// ]
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.3.44...0.4.0
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.3.43...0.3.44
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.3.42...0.3.43
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.3.41...0.3.42
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.3.40...0.3.41
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.3.39...0.3.40
Full Changelog: https://github.com/boundwize/jsonrecast/compare/0.3.38...0.3.39
How can I help you explore Laravel packages today?