Skip to content

Commit

Permalink
fix: Configure the printer to preserve formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Jun 16, 2024
1 parent 41eff3d commit 42bbb85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/PhpParser/Printer/StandardPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down

0 comments on commit 42bbb85

Please sign in to comment.