Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Php74] Mirror comment on Closure return to ArrowFunction expr on ClosureToArrowFunctionRector #1677

Merged
merged 9 commits into from
Jan 14, 2022

Conversation

samsonasik
Copy link
Member

*/
// something
// @psalm-suppress UndefinedFunction
ff();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this tweak on BetterStandardPrinter::p() currently make duplicate comment for existing arrow function:

      */
     // something
     // @psalm-suppress UndefinedFunction
-    ff();
+    /**
+     * comment
+     */
+// something
+// @psalm-suppress UndefinedFunction

which incorrect.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved by add new AttributeKey to flag if comment is mirrored 6f29de7

-----
<?php

fn() => /** @psalm-suppress UndefinedFunction */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep start comment on current line is on purpose to avoid make creating a tab spaces which will fail on compare in test.

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba
Copy link
Member

Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants