<commit_before><?php


class CM_MysqlResult {
	/**
	 * @var mysqli_result
	 */
	private $_result;

	/**
	 * @param mysqli_result $result
	 * @return CM_MysqlResult
	 */
	public function __construct(mysqli_result $result) {
		$this->_result = $result;
	}

	/**
	 * Get number of rows in result.
	 *
	 * @return integer
	 */
	public function numRows() {
		return $this->_result->num_rows;
	}

	/**
	 * Fetch a result row as an object.
	 *
	 * @param string $class_name
	 * @param array  $params
	 * @return object an object with string properties that correspond to the fetched row, or FALSE if there are no more rows.
	 * @deprecated
	 */
	public function fetchObject($class_name = null, array $params = null) {
		if (!isset($class_name)) {
			$result_obj = $this->_result->fetch_object();
		} elseif (!isset($params)) {
			$result_obj = $this->_result->fetch_object($class_name);
		} else {
			$result_obj = $this->_result->fetch_object($class_name, $params);
		}

		return $result_obj;
	}

	/**
	 * Next row's first Value
	 *
	 * @return mixed|false
	 */
	public function fetchOne() {
		$row = $this->_result->fetch_row();
		if (is_null($row)) {
			return false;
		}
		return reset($row);
	}

	/**
	 * Next row as associative Field=>Value array
	 *
	 * @return array|false
	 */
	public function fetchAssoc() {
		return $this->_result->fetch_assoc();
	}

	/**
	 * Numeric array of first Values
	 *
	 * @return array
	 */
	public function fetchCol() {
		$col = array();<commit_msg>Fix mysql fetchAssoc() return type<commit_after><?php


class CM_MysqlResult {
	/**
	 * @var mysqli_result
	 */
	private $_result;

	/**
	 * @param mysqli_result $result
	 * @return CM_MysqlResult
	 */
	public function __construct(mysqli_result $result) {
		$this->_result = $result;
	}

	/**
	 * Get number of rows in result.
	 *
	 * @return integer
	 */
	public function numRows() {
		return $this->_result->num_rows;
	}

	/**
	 * Fetch a result row as an object.
	 *
	 * @param string $class_name
	 * @param array  $params
	 * @return object an object with string properties that correspond to the fetched row, or FALSE if there are no more rows.
	 * @deprecated
	 */
	public function fetchObject($class_name = null, array $params = null) {
		if (!isset($class_name)) {
			$result_obj = $this->_result->fetch_object();
		} elseif (!isset($params)) {
			$result_obj = $this->_result->fetch_object($class_name);
		} else {
			$result_obj = $this->_result->fetch_object($class_name, $params);
		}

		return $result_obj;
	}

	/**
	 * Next row's first Value
	 *
	 * @return mixed|false
	 */
	public function fetchOne() {
		$row = $this->_result->fetch_row();
		if (is_null($row)) {
			return false;
		}
		return reset($row);
	}

	/**
	 * Next row as associative Field=>Value array
	 *
	 * @return array|null
	 */
	public function fetchAssoc() {
		return $this->_result->fetch_assoc();
	}

	/**
	 * Numeric array of first Values
	 *
	 * @return array
	 */
	public function fetchCol() {
		$col = array();
{'fraction_non_alphanumeric': 0.14630872483221477, 'fraction_numerical': 0.0, 'mean_word_length': 3.3015873015873014, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '1849111', 'n_tokens_mistral': 1086, 'n_tokens_neox': 967, 'n_words': 261}