diff --git a/rules/Php74/Rector/Closure/ClosureToArrowFunctionRector.php b/rules/Php74/Rector/Closure/ClosureToArrowFunctionRector.php index ae4338ddebf..d183c2f40d6 100644 --- a/rules/Php74/Rector/Closure/ClosureToArrowFunctionRector.php +++ b/rules/Php74/Rector/Closure/ClosureToArrowFunctionRector.php @@ -89,7 +89,7 @@ public function refactor(Node $node): ?Node $comments = $node->stmts[0]->getAttribute(AttributeKey::COMMENTS) ?? []; if ($comments !== []) { $this->mirrorComments($arrowFunction->expr, $node->stmts[0]); - $arrowFunction->setAttribute(AttributeKey::COMMENTS, true); + $arrowFunction->setAttribute(AttributeKey::COMMENTS, $node->stmts[0]->getComments()); } return $arrowFunction;