Returns a rendered form to comment the given node.
\Drupal\Core\Entity\EntityInterface $node: The node entity to be commented.
int $pid: (optional) Some comments are replies to other comments. In those cases, $pid is the parent comment's comment ID. Defaults to NULL.
array The renderable array for the comment addition form.
function comment_add(EntityInterface $node, $pid = NULL) {
$values = array(
'nid' => $node->nid,
'pid' => $pid,
'node_type' => 'comment_node_' . $node->type,
);
$comment = entity_create('comment', $values);
return entity_get_form($comment);
}