Readme > Explain print_node (#5595)

This commit is contained in:
Ruud Kamphuis 2021-02-17 12:48:35 +01:00 committed by GitHub
parent 242c6371d3
commit 1561e108c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,7 +229,8 @@ Or with Xdebug:
vendor/bin/rector process src/Controller --dry-run --xdebug
```
To assist with echo-style debugging rector provides a `rd()` helper method which is useful to pretty-print AST-nodes:
To assist with echo-style debugging rector provides a [`print_node()` helper](tests/debug_functions.php) method
which is useful to pretty-print AST-nodes:
```php
/**
@ -237,7 +238,7 @@ To assist with echo-style debugging rector provides a `rd()` helper method which
*/
public function refactor(Node $node): ?Node
{
rd($node);
print_node($node);
die;
}
```