/** * @param DocCommentNode $comment * @return $this */ public function setDocComment(DocCommentNode $comment) { if (isset($this->docComment)) { $this->docComment->remove(); } $indent = $this->getIndent(); $comment->setIndent($indent); $nl = FormatterFactory::getDefaultFormatter()->getConfig('nl'); /** @var ParentNode $this */ $this->firstChild()->before([$comment, WhitespaceNode::create($nl . $indent)]); $this->docComment = $comment; return $this; }