mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-04-21 06:22:12 +02:00
Fix NodeDecoder
=> JsonDecoder
in docs (#552)
This commit is contained in:
parent
a74b54ce8b
commit
ebf6b1c33b
@ -116,8 +116,8 @@ The JSON representation may be converted back into an AST using the `JsonDecoder
|
||||
```php
|
||||
<?php
|
||||
|
||||
$nodeDecoder = new PhpParser\NodeDecoder();
|
||||
$ast = $nodeDecoder->decode($json);
|
||||
$jsonDecoder = new PhpParser\JsonDecoder();
|
||||
$ast = $jsonDecoder->decode($json);
|
||||
```
|
||||
|
||||
Note that not all ASTs can be represented using JSON. In particular:
|
||||
@ -128,4 +128,4 @@ Note that not all ASTs can be represented using JSON. In particular:
|
||||
|
||||
If the node tree is not representable in JSON, the initial `json_encode()` call will fail.
|
||||
|
||||
From the command line, a JSON dump can be obtained using `vendor/bin/php-parse -j file.php`.
|
||||
From the command line, a JSON dump can be obtained using `vendor/bin/php-parse -j file.php`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user