<commit_before><?php

namespace Nfilin\Libs\Yii;

use Nfilin\Libs\Pager as ZeusPager; 
use yii\db\QueryInterface;
use yii\base\InvalidParamException as Exception;

/**
 * @inheritdoc
 * Uses [[QueryInterface]] as input data
 */
class ActivePager extends ZeusPager {
	private $__hooks = [];
	/**
	 * @param QueryInterface $query
	 * @throw Exception If [[$query]] is not [[QueryInterface]]
	 */
	function __construct($query = null) {
		if(empty($query) || !($query instanceof QueryInterface))
			throw new Exception('Incorrect query');
		$this->query = $query;
	}

	function each($function, $params = []){
		$this->__hooks[] = [$function, $params];
	}

	/**
	 * @inheritdoc
	 */
	function build(){
        $this->total_count  = (int) $this->query->count();
        $this->objects      = $this->query->limit($this->limit)->offset($this->offset)->all()->toArray();<commit_msg>ActivePager::each -> return $this<commit_after><?php

namespace Nfilin\Libs\Yii;

use Nfilin\Libs\Pager as ZeusPager; 
use yii\db\QueryInterface;
use yii\base\InvalidParamException as Exception;

/**
 * @inheritdoc
 * Uses [[QueryInterface]] as input data
 */
class ActivePager extends ZeusPager {
	private $__hooks = [];
	/**
	 * @param QueryInterface $query
	 * @throw Exception If [[$query]] is not [[QueryInterface]]
	 */
	function __construct($query = null) {
		if(empty($query) || !($query instanceof QueryInterface))
			throw new Exception('Incorrect query');
		$this->query = $query;
	}

	function each($function, $params = []){
		$this->__hooks[] = [$function, $params];
		return $this;
	}

	/**
	 * @inheritdoc
	 */
	function build(){
        $this->total_count  = (int) $this->query->count();
        $this->objects      = $this->query->limit($this->limit)->offset($this->offset)->all()->toArray();
{'fraction_non_alphanumeric': 0.18125701459034793, 'fraction_numerical': 0.0, 'mean_word_length': 4.07977207977208, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 30, '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': '3934760', 'n_tokens_mistral': 600, 'n_tokens_neox': 576, 'n_words': 127}