diff --git a/src/PhpParser/Printer/StandardPrinter.php b/src/PhpParser/Printer/StandardPrinter.php index 7950b859..279abf02 100644 --- a/src/PhpParser/Printer/StandardPrinter.php +++ b/src/PhpParser/Printer/StandardPrinter.php @@ -24,7 +24,11 @@ public function __construct(private PrettyPrinter $decoratedPrinter) public function print(array $newStmts, array $oldStmts, array $oldTokens): string { - $printedStatements = $this->decoratedPrinter->prettyPrintFile($newStmts); + $printedStatements = $this->decoratedPrinter->printFormatPreserving( + $newStmts, + $oldStmts, + $oldTokens, + ); return $printedStatements."\n"; }