/** * @param \EBT\ExtensionBuilder\Domain\Model\AbstractObject $object * @param \PhpParser\Node\Stmt $node */ protected function addCommentAttributes(\EBT\ExtensionBuilder\Domain\Model\AbstractObject $object, \PhpParser\Node\Stmt $node) { $commentAttributes = array(); $comments = $object->getComments(); if (count($comments) > 0) { foreach ($comments as $comment) { $commentAttributes[] = new \PhpParser\Comment($comment); } } if ($object->hasDescription() || $object->hasTags()) { $commentAttributes[] = new \PhpParser\Comment\Doc($object->getDocComment()); } $node->setAttribute('comments', $commentAttributes); }