<commit_before><?php

namespace MongoDB;

use MongoDB\Driver\WriteResult;

/**
 * Result class for a multi-document write operation.
 */
class InsertManyResult
{
    private $writeResult;
    private $insertedIds;

    /**
     * Constructor.
     *
     * @param WriteResult $writeResult
     * @param mixed[]     $insertedIds
     */
    public function __construct(WriteResult $writeResult, array $insertedIds = array())
    {
        $this->writeResult = $writeResult;
        $this->insertedIds = $insertedIds;
    }

    /**
     * Return the number of documents that were inserted.
     *
     * This value is undefined if the write was not acknowledged.
     *
     * @see InsertManyResult::isAcknowledged()
     * @return integer
     */
    public function getInsertedCount()
    {
        return $this->writeResult->getInsertedCount();
    }

    /**
     * Return a map of the inserted documents' IDs.
     *
     * The index of each ID in the map corresponds to the document's position
     * in bulk operation. If the document already an ID prior to insertion (i.e.
     * the driver did not need to generate an ID), this will contain its "_id".
     * Any driver-generated ID will be an MongoDB\Driver\ObjectID instance.
     *
     * @return mixed[]
     */
    public function getInsertedIds()
    {
        return $this->insertedIds;
    }

    /**
     * Return whether this insert result was acknowledged by the server.
     *<commit_msg>Revise InsertManyResult::getInsertedIds() documentation<commit_after><?php

namespace MongoDB;

use MongoDB\Driver\WriteResult;

/**
 * Result class for a multi-document write operation.
 */
class InsertManyResult
{
    private $writeResult;
    private $insertedIds;

    /**
     * Constructor.
     *
     * @param WriteResult $writeResult
     * @param mixed[]     $insertedIds
     */
    public function __construct(WriteResult $writeResult, array $insertedIds = array())
    {
        $this->writeResult = $writeResult;
        $this->insertedIds = $insertedIds;
    }

    /**
     * Return the number of documents that were inserted.
     *
     * This value is undefined if the write was not acknowledged.
     *
     * @see InsertManyResult::isAcknowledged()
     * @return integer
     */
    public function getInsertedCount()
    {
        return $this->writeResult->getInsertedCount();
    }

    /**
     * Return a map of the inserted documents' IDs.
     *
     * The index of each ID in the map corresponds to the document's position
     * in bulk operation. If the document had an ID prior to insertion (i.e. the
     * driver did not generate an ID), this will contain its "_id" field value.
     * Any driver-generated ID will be an MongoDB\Driver\ObjectID instance.
     *
     * @return mixed[]
     */
    public function getInsertedIds()
    {
        return $this->insertedIds;
    }

    /**
     * Return whether this insert result was acknowledged by the server.
     *
{'fraction_non_alphanumeric': 0.09398242055442867, 'fraction_numerical': 0.0, 'mean_word_length': 2.4608187134502923, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1845116', 'n_tokens_mistral': 829, 'n_tokens_neox': 806, 'n_words': 274}