Skip to content

Commit 6635c30

Browse files
committed
final touch: mirror comment of ArrowFunction as its stmt
1 parent bb06099 commit 6635c30

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rules/Php74/Rector/Closure/ClosureToArrowFunctionRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function refactor(Node $node): ?Node
8989
$comments = $node->stmts[0]->getAttribute(AttributeKey::COMMENTS) ?? [];
9090
if ($comments !== []) {
9191
$this->mirrorComments($arrowFunction->expr, $node->stmts[0]);
92-
$arrowFunction->setAttribute(AttributeKey::COMMENTS, []);
92+
$arrowFunction->setAttribute(AttributeKey::COMMENTS, $node->stmts[0]->getComments());
9393
}
9494

9595
return $arrowFunction;

0 commit comments

Comments
 (0)