diff --git a/src/PhpParser/Printer/Printer.php b/src/PhpParser/Printer/Printer.php index 3f6b22bc..376c94ce 100644 --- a/src/PhpParser/Printer/Printer.php +++ b/src/PhpParser/Printer/Printer.php @@ -15,13 +15,14 @@ namespace Humbug\PhpScoper\PhpParser\Printer; use PhpParser\Node; +use PhpParser\Token; interface Printer { /** - * @param Node[] $newStmts - * @param Node[] $oldStmts - * @param array $oldTokens + * @param Node[] $newStmts + * @param Node[] $oldStmts + * @param Token[] $oldTokens */ public function print(array $newStmts, array $oldStmts, array $oldTokens): string; } diff --git a/src/PhpParser/Printer/StandardPrinter.php b/src/PhpParser/Printer/StandardPrinter.php index 07e3b6cd..7950b859 100644 --- a/src/PhpParser/Printer/StandardPrinter.php +++ b/src/PhpParser/Printer/StandardPrinter.php @@ -14,16 +14,18 @@ namespace Humbug\PhpScoper\PhpParser\Printer; -use PhpParser\PrettyPrinterAbstract; +use PhpParser\PrettyPrinter; final readonly class StandardPrinter implements Printer { - public function __construct(private PrettyPrinterAbstract $decoratedPrinter) + public function __construct(private PrettyPrinter $decoratedPrinter) { } public function print(array $newStmts, array $oldStmts, array $oldTokens): string { - return $this->decoratedPrinter->prettyPrintFile($newStmts)."\n"; + $printedStatements = $this->decoratedPrinter->prettyPrintFile($newStmts); + + return $printedStatements."\n"; } }