<commit_before><?php

class QueryTool
{
    private $__pdoMap = array(
    'integer' => PDO::PARAM_INT,
    'float' => PDO::PARAM_STR,
    'boolean' => PDO::PARAM_BOOL,
    'string' => PDO::PARAM_STR,
    'text' => PDO::PARAM_STR
    );

    public function quickDelete($table, $field, $value, $model)
    {
        $db = $model->getDataSource();
        $connection = $db->getConnection();
        if ($db->config['datasource'] == 'Database/Mysql' || $db->config['datasource'] == 'Database/MysqlObserver') {
            $query = $connection->prepare('DELETE FROM ' . $table . ' WHERE ' . $field . ' = :value');
        } elseif ($db->config['datasource'] == 'Database/Postgres' ) {
            $query = $connection->prepare('DELETE FROM "' . $table . '" WHERE "' . $field . '" = :value');
        }
        $query->bindValue(':value', $value, $this->__pdoMap[$db->introspectType($value)]);<commit_msg>chg: [internal] Convert array to const in QueryTool<commit_after><?php

class QueryTool
{
    const PDO_MAP = array(
        'integer' => PDO::PARAM_INT,
        'float' => PDO::PARAM_STR,
        'boolean' => PDO::PARAM_BOOL,
        'string' => PDO::PARAM_STR,
        'text' => PDO::PARAM_STR,
    );

    public function quickDelete($table, $field, $value, $model)
    {
        $db = $model->getDataSource();
        $connection = $db->getConnection();
        if ($db->config['datasource'] === 'Database/Mysql' || $db->config['datasource'] === 'Database/MysqlObserver') {
            $query = $connection->prepare('DELETE FROM ' . $table . ' WHERE ' . $field . ' = :value');
        } elseif ($db->config['datasource'] == 'Database/Postgres' ) {
            $query = $connection->prepare('DELETE FROM "' . $table . '" WHERE "' . $field . '" = :value');
        }
        $query->bindValue(':value', $value, self::PDO_MAP[$db->introspectType($value)]);
{'fraction_non_alphanumeric': 0.20441097364174288, 'fraction_numerical': 0.0, 'mean_word_length': 2.9658848614072495, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 32, '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': '5366075', 'n_tokens_mistral': 597, 'n_tokens_neox': 595, 'n_words': 108}