Fix NodeDecoder => JsonDecoder in docs (#552)

This commit is contained in:
Cosmin Radoi 2018-11-29 14:12:33 -08:00 committed by Nikita Popov
parent a74b54ce8b
commit ebf6b1c33b

View File

@ -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`.