<commit_before><?php

class MongoRecordIterator 
	implements Iterator, Countable
{
	protected $current; // a PHP5.3 pointer hack to make current() work
	protected $cursor;
	protected $className;
  
	public function __construct(MongoCursor $cursor, $className)
	{
		$this->cursor = $cursor;
		$this->className = $className;
		$this->cursor->rewind();
		$this->current = $this->current();
	}
  
	public function current()
	{
		$this->current = $this->instantiate($this->cursor->current());
		return $this->current;
	}

	public function count()
	{
		return $this->cursor->count();
	}
  
	public function key()
	{
		return $this->cursor->key();
	}
  
	public function next()
	{
		$this->cursor->next();
	}
  
	public function rewind()<commit_msg>Relax type constraint on MongoRecordIterator so that custom Cursor implementations can be used. Since MongoCursor is a class and not an interface, it's hard to extend, meaning most wrapper cursors won't be of type MongoCursor.<commit_after><?php

class MongoRecordIterator 
	implements Iterator, Countable
{
	protected $current; // a PHP5.3 pointer hack to make current() work
	protected $cursor;
	protected $className;
  
	public function __construct($cursor, $className)
	{
		$this->cursor = $cursor;
		$this->className = $className;
		$this->cursor->rewind();
		$this->current = $this->current();
	}
  
	public function current()
	{
		$this->current = $this->instantiate($this->cursor->current());
		return $this->current;
	}

	public function count()
	{
		return $this->cursor->count();
	}
  
	public function key()
	{
		return $this->cursor->key();
	}
  
	public function next()
	{
		$this->cursor->next();
	}
  
	public function rewind()
{'fraction_non_alphanumeric': 0.14362017804154303, 'fraction_numerical': 0.002373887240356083, 'mean_word_length': 4.109090909090909, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '7559729', 'n_tokens_mistral': 560, 'n_tokens_neox': 528, 'n_words': 144}