Skip to content

How can I add a new comment? #8448

Answered by samsonasik
jkraai asked this question in Q&A
Jan 31, 2024 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

It depends on what you want to achieve, if only add, which means replace if any exists, you can do:

 $node->setDocComment(new Doc("/** test **/"));

ensure that $node is a \PhpParser\Node\Stmt instance.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jkraai
Comment options

@samsonasik
Comment options

@jkraai
Comment options

@samsonasik
Comment options

Answer selected by samsonasik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants