How to add inline comment? #7489
Answered
by
samsonasik
javaDeveloperKid
asked this question in
Q&A
-
Consider this example: function myFunction($param) {} I want to get this: function myFunction(/** foo */ $param) {} // might be also a simple comment, i.e. /* foo */, doesn't matter but I get this: function myFunction(/** foo */
$param) {} My rector: public function refactor(Node $node): ?Node
{
foreach ($node->params as $param) {
$param->setDocComment(new Doc('/** foo */'));
}
} Somebody help? |
Beta Was this translation helpful? Give feedback.
Answered by
samsonasik
Sep 17, 2022
Replies: 1 comment
-
That's not possible per PHPParser nikic/PHP-Parser#791, comment is belong to next stmt ( at least for now). |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
samsonasik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's not possible per PHPParser nikic/PHP-Parser#791, comment is belong to next stmt ( at least for now).