How to add inline comment? #7489
|
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 matterbut 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? |
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). |
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).