<commit_before><?php

declare(strict_types=1);

namespace bed;

require_once 'Database.php';
require_once 'utils/arrays/isAssoc.php';
require_once 'utils/sql/createPlaceholders.php';
require_once 'utils/sql/buildUpdateBody.php';

/**
 * Generic class with common database operations.
 */
class Dao {

	protected $db;

	/**
	 * Map from name to type as specified by the Col class.
	 */
	protected $columns;
	protected $columnNames;

	protected $tableName;
	protected $idName;

	public function __construct(
		Database $db,
		array $columns,
		string $table = null
	) {
		$this->db = $db;

		$this->columns = $columns;
		$this->columnNames = array_keys($columns);
		$this->columnTypes = array_values($columns);<commit_msg>Remove unnecessary dependency<commit_after><?php

declare(strict_types=1);

namespace bed;

require_once 'Database.php';
require_once 'utils/sql/createPlaceholders.php';
require_once 'utils/sql/buildUpdateBody.php';

/**
 * Generic class with common database operations.
 */
class Dao {

	protected $db;

	/**
	 * Map from name to type as specified by the Col class.
	 */
	protected $columns;
	protected $columnNames;

	protected $tableName;
	protected $idName;

	public function __construct(
		Database $db,
		array $columns,
		string $table = null
	) {
		$this->db = $db;

		$this->columns = $columns;
		$this->columnNames = array_keys($columns);
		$this->columnTypes = array_values($columns);
{'fraction_non_alphanumeric': 0.12862190812720847, 'fraction_numerical': 0.0014134275618374558, 'mean_word_length': 4.53125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1912117', 'n_tokens_mistral': 475, 'n_tokens_neox': 445, 'n_words': 117}