1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2025-01-20 12:46:47 +01:00

Add a a reference to PrettyPrinter to code generation doc

The `$prettyPrinter` variable was undefined in the doc.

Also, the PrettyPrinter was mentioned as `default`, but it's `Standard`, actually.
This commit is contained in:
Stepan Anchugov 2014-12-11 16:29:15 +05:00 committed by Nikita Popov
parent 800d278369
commit f5432a76b6

View File

@ -36,13 +36,15 @@ $node = $factory->class('SomeClass')
; ;
$stmts = array($node); $stmts = array($node);
echo $prettyPrinter->prettyPrint($stmts); $prettyPrinter = new PhpParser\PrettyPrinter\Standard();
echo $prettyPrinter->prettyPrintFile($stmts);
``` ```
This will produce the following output with the default pretty printer: This will produce the following output with the standard pretty printer:
```php ```php
<?php <?php
abstract class SomeClass extends SomeOtherClass implements A\Few, Interfaces abstract class SomeClass extends SomeOtherClass implements A\Few, Interfaces
{ {
protected $someProperty; protected $someProperty;