<commit_before><?php

namespace RadHam;

class DataDX extends \PDO
{
  
    protected $dbDriver,
              $dbHost,
              $dbName,
              $dbUser,
              $dbPass,
              $dbh;

    /**
     * @param string $dbDriver
     * @param string $dbHost
     * @param string $dbUser
     * @param string $dbPass
     * @param bool $dbName
     *
     * @return DataDX
     */
    public function __construct($dbDriver, $dbHost, $dbUser, $dbPass, $dbName = false)
    {
        try {
            $dsn = "{$dbDriver}:host={$dbHost}";
            if ($dbName) {
                $dsn .= ";dbname={$dbName}";
            }
            $options = array(
                self::ATTR_ERRMODE => self::ERRMODE_EXCEPTION
            );
            $this->dbh = parent::__construct($dsn, $dbUser, $dbPass, $options);
            foreach (['Driver', 'Host', 'User', 'Pass', 'Name'] as $param) {
                $this->db{$param} = ${"db{$param}"};
            }
        } catch (\PDOException $e) {
            die($e->getMessage());
        }

        return $this;
    }

    /**
     * @param string|bool $sql
     *
     * @return array
     */
    public function get($sql = false)
    {
        return $this->query($sql)->fetchAll(self::FETCH_ASSOC);
    }

    /**
     * @param $table
     *
     * @return mixed
     */
    public function getColNames($table)
    {
        $database = $this->dbName;
        $sql = "SELECT `COLUMN_NAME`
                FROM `information_schema`.`COLUMNS`
                WHERE `TABLE_SCHEMA` = '{$database}'
                    AND `TABLE_NAME` = '{$table}'";

        return $this->query($sql)->fetchAll(self::FETCH_COLUMN);
    }

    /**
     * @return void
     */
    public function close()
    {
        $this->dbh = null;
    }
} <commit_msg>Updated the constructor.<commit_after><?php

namespace RadHam;

class DataDX extends \PDO
{
  
    protected $dbDriver,
              $dbHost,
              $dbName,
              $dbUser,
              $dbPass,
              $dbh;

    /**
     * @param string $dbDriver
     * @param string $dbHost
     * @param string $dbUser
     * @param string $dbPass
     * @param bool $dbName
     *
     * @return DataDX
     */
    public function __construct($dbDriver, $dbHost, $dbUser, $dbPass, $dbName = false)
    {
        try {
            $dsn = "{$dbDriver}:host={$dbHost}";
            if ($dbName) {
                $dsn .= ";dbname={$dbName}";
            }
            $options = array(
                self::ATTR_ERRMODE => self::ERRMODE_EXCEPTION
            );
            parent::__construct($dsn, $dbUser, $dbPass, $options);
            $this->dbDriver = $dbDriver;
            $this->dbHost   = $dbHost;
            $this->dbUser   = $dbUser;
            $this->dbPass   = $dbPass;
            $this->dbName   = $dbName;
        } catch (\PDOException $e) {
            die($e->getMessage());
        }

        return $this;
    }

    /**
     * @param string|bool $sql
     *
     * @return array
     */
    public function get($sql = false)
    {
        return $this->query($sql)->fetchAll(self::FETCH_ASSOC);
    }

    /**
     * @param $table
     *
     * @return mixed
     */
    public function getColNames($table)
    {
        $database = $this->dbName;
        $sql = "SELECT `COLUMN_NAME`
                FROM `information_schema`.`COLUMNS`
                WHERE `TABLE_SCHEMA` = '{$database}'
                    AND `TABLE_NAME` = '{$table}'";

        return $this->query($sql)->fetchAll(self::FETCH_COLUMN);
    }

    /**
     * @return void
     */
    public function close()
    {
        $this->dbh = null;
    }
} 
{'fraction_non_alphanumeric': 0.1496858781753619, 'fraction_numerical': 0.0, 'mean_word_length': 1.5342560553633218, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, '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': '4465217', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1139, 'n_words': 223}