public function get_posts_exporter(
        stdClass $user,
        forum_entity $forum,
        discussion_entity $discussion,
        array $posts,
        array $authorsbyid = [],
        array $authorcontextids = [],
        array $attachmentsbypostid = [],
        array $groupsbyauthorid = [],
        post_read_receipt_collection_entity $readreceiptcollection = null,
        array $tagsbypostid = [],
        array $ratingbypostid = [],
        bool $includehtml = false
    ) : posts_exporter {
        return new posts_exporter(
            $posts,
            $authorsbyid,
            $authorcontextids,
            $attachmentsbypostid,
            $groupsbyauthorid,
            $tagsbypostid,
            $ratingbypostid,
            [
                'capabilitymanager' => $this->managerfactory->get_capability_manager($forum),
                'urlfactory' => $this->urlfactory,
                'forum' => $forum,
                'discussion' => $discussion,
                'user' => $user,
                'context' => $forum->get_context(),
                'readreceiptcollection' => $readreceiptcollection,
                'includehtml' => $includehtml
            ]
        );
    }