From b947164ea4ed882c180843649d13d4e7843baca2 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sun, 26 Oct 2025 12:28:42 +0700 Subject: [PATCH 1/2] [Php85] Handle indent inside class method on NestedToPipeOperatorRector --- .../Fixture/inside_class_method.php.inc | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 rules-tests/Php85/Rector/StmtsAwareInterface/NestedToPipeOperatorRector/Fixture/inside_class_method.php.inc diff --git a/rules-tests/Php85/Rector/StmtsAwareInterface/NestedToPipeOperatorRector/Fixture/inside_class_method.php.inc b/rules-tests/Php85/Rector/StmtsAwareInterface/NestedToPipeOperatorRector/Fixture/inside_class_method.php.inc new file mode 100644 index 00000000000..8ed58707cf6 --- /dev/null +++ b/rules-tests/Php85/Rector/StmtsAwareInterface/NestedToPipeOperatorRector/Fixture/inside_class_method.php.inc @@ -0,0 +1,34 @@ + +----- + function3(...) + |> function2(...) + |> function1(...); + } +} + +?> From 3843cb69e602b93d4ea75c38c43dbad43f72dee5 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sun, 26 Oct 2025 12:29:47 +0700 Subject: [PATCH 2/2] fix --- src/PhpParser/Printer/BetterStandardPrinter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpParser/Printer/BetterStandardPrinter.php b/src/PhpParser/Printer/BetterStandardPrinter.php index bd8f15c48cb..08d285272f2 100644 --- a/src/PhpParser/Printer/BetterStandardPrinter.php +++ b/src/PhpParser/Printer/BetterStandardPrinter.php @@ -326,7 +326,7 @@ protected function pExpr_BinaryOp_Pipe(Pipe $node, int $precedence, int $lhsPrec return $this->pInfixOp( Pipe::class, $node->left, - $this->nl . $this->resolveIndentSpaces() . '|> ', + "\n" . $this->resolveIndentSpaces() . '|> ', $node->right, $precedence, $lhsPrecedence