<commit_before><?php
namespace phpgt\fetch;

use React\Promise\Deferred;

/**
 * Contains multiple requests and their promises.
 */
class RequestResolver implements \Iterator {

private $requestArray = [];
private $deferredArray = [];
private $index;

public function __construct() {

}

public function add(Request $request, Deferred $deferred) {
	$this->requestArray []= $request;
	$this->deferredArray []= $deferred;
}

public function current() {
	return $this->deferredArray[$this->index];
}

public function key() {
	return $this->requestArray[$this->index];
}

public function next() {
	++ $this->index;
}

public function rewind() {
	$this->index = 0;
}

public function valid() {
	return isset($this->requestArray[$this->index]);
}

}#<commit_msg>Show iterator methods.<commit_after><?php
namespace phpgt\fetch;

use React\Promise\Deferred;

/**
 * Contains multiple requests and their promises.
 */
class RequestResolver implements \Iterator {

private $requestArray = [];
private $deferredArray = [];
private $index;

public function __construct() {

}

// Iterator methods ////////////////////////////////////////////////////////////

public function add(Request $request, Deferred $deferred) {
	$this->requestArray []= $request;
	$this->deferredArray []= $deferred;
}

public function current() {
	return $this->deferredArray[$this->index];
}

public function key() {
	return $this->requestArray[$this->index];
}

public function next() {
	++ $this->index;
}

public function rewind() {
	$this->index = 0;
}

public function valid() {
	return isset($this->requestArray[$this->index]);
}

}#
{'fraction_non_alphanumeric': 0.18902058640049907, 'fraction_numerical': 0.0012476606363069245, 'mean_word_length': 4.092063492063492, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '82760', 'n_tokens_mistral': 482, 'n_tokens_neox': 481, 'n_words': 120}