From a9282514c87183544ce7745ee593b1f63cdd8012 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 9 Jan 2021 18:36:41 +0100 Subject: [PATCH] Properly parenthesise arrow functions --- lib/PhpParser/PrettyPrinter/Standard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PhpParser/PrettyPrinter/Standard.php b/lib/PhpParser/PrettyPrinter/Standard.php index 41095b2..daab71e 100644 --- a/lib/PhpParser/PrettyPrinter/Standard.php +++ b/lib/PhpParser/PrettyPrinter/Standard.php @@ -638,7 +638,7 @@ class Standard extends PrettyPrinterAbstract . '(' . $this->pCommaSeparated($node->params) . ')' . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') . ' => ' - . $this->p($node->expr); + . $this->pDereferenceLhs($node->expr); } protected function pExpr_ClosureUse(Expr\ClosureUse $node) {