/** * @param \EBT\ExtensionBuilder\Domain\Model\AbstractObject $object * @param \PhpParser\Node\Stmt $node */ protected function addCommentsFromAttributes(Model\AbstractObject $object, \PhpParser\Node\Stmt $node) { $comments = $node->getAttribute('comments'); if (is_array($comments)) { foreach ($comments as $comment) { if ($comment instanceof \PhpParser\Comment\Doc) { $object->setDocComment($comment->getReformattedText()); } elseif ($comment instanceof \PhpParser\Comment) { $object->addComment($comment->getText()); } } } }