<commit_before><?php

namespace MongoDB\Model;

use FilterIterator;

class CollectionInfoLegacyIterator extends FilterIterator implements CollectionInfoIterator
{
    /**
     * Return the current element as a CollectionInfo instance.
     *
     * @return CollectionInfo
     */
    public function current()
    {
        $info = parent::current();

        // Trim the database prefix up to and including the first dot<commit_msg>PHPLIB-45: Construct CollectionInfoLegacyIterator from Traversable<commit_after><?php

namespace MongoDB\Model;

use FilterIterator;
use Iterator;
use IteratorIterator;
use Traversable;

class CollectionInfoLegacyIterator extends FilterIterator implements CollectionInfoIterator
{
    /**
     * Constructor.
     *
     * @param Traversable $iterator
     */
    public function __construct(Traversable $iterator)
    {
        /* FilterIterator requires an Iterator, so wrap all other Traversables
         * with an IteratorIterator as a convenience.
         */
        if ( ! $iterator instanceof Iterator) {
            $iterator = new IteratorIterator($iterator);
        }

        parent::__construct($iterator);
    }

    /**
     * Return the current element as a CollectionInfo instance.
     *
     * @return CollectionInfo
     */
    public function current()
    {
        $info = parent::current();

        // Trim the database prefix up to and including the first dot
{'fraction_non_alphanumeric': 0.07605633802816901, 'fraction_numerical': 0.0014084507042253522, 'mean_word_length': 2.8405405405405406, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5314000', 'n_tokens_mistral': 356, 'n_tokens_neox': 350, 'n_words': 114}