<commit_before><?php

class WEATHER
{
    public function __construct($database)
	{
		$this->database = $database;
	}

    public function getUserByPhone($phone)
    {
        return $this->database->run('SELECT * FROM `users` WHERE phone = ?', $phone);
    }
    public function checkUserByPhone($phone)
    {
        $pdo = $this->database->getPdo();
        $pdoQuery = $pdo->prepare('SELECT * FROM `users` WHERE phone = :phone');
            $pdoQuery->bindParam(':phone', $phone);
            $pdoQuery->execute();
            $count = $pdoQuery->rowCount();
            return $count;
    }
    public function makeNewUser($phone)
    {
        $columns = [
            'phone',
            'active'
        ];
        $data_array = [
            $phone,
            '0'
        ];
        $insert = $this->$database->buildInsertQuery('users', $columns);
        $this->$database->q(
            $insert,
            $data_array,
            \PDO::FETCH_BOTH,
            true
        );
    }
    public function addZip($phone, $zip)
    {
        $pdo = $this->database->getPdo();
        $pdoQuery = $pdo->prepare('UPDATE `users` SET zip = :zip WHERE phone = :phone');
            $pdoQuery->bindParam(':zip', $zip);
            $pdoQuery->bindParam(':phone', $phone);
            $pdoQuery->execute();
    }
    public function makeActive($phone)
    {
        return $this->database->run('UPDATE `users` SET active = 1 WHERE phone = ?', $phone);
    }

}

?><commit_msg>fix my terrible horrible no good (ab)use of EasyDB<commit_after><?php

class WEATHER
{
    public function __construct($database)
	{
		$this->database = $database;
	}

    public function getUserByPhone($phone)
    {
        return $this->database->run('SELECT * FROM `users` WHERE phone = ?', $phone);
    }
    public function checkUserByPhone($phone)
    {
        $pdo = $this->database->getPdo();
        $pdoQuery = $pdo->prepare('SELECT * FROM `users` WHERE phone = :phone');
            $pdoQuery->bindParam(':phone', $phone);
            $pdoQuery->execute();
            $count = $pdoQuery->rowCount();
            return $count;
    }
    public function makeNewUser($phone)
    {
        $this->database->insert('users', [
            'phone' => $phone,
        ]);
    }
    public function addZip($phone, $zip)
    {
        $this->database->update('users', [
            'zip' => $zip
        ], [
            'phone' => $phone
        ]);
    }
    public function makeActive($phone)
    {
        $this->database->update('users', [
            'active' => 1
        ], [
            'phone' => $phone
        ]);
    }

}

?>
{'fraction_non_alphanumeric': 0.16240945482272207, 'fraction_numerical': 0.001143728555089592, 'mean_word_length': 1.9417040358744395, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 46, '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': '5855595', 'n_tokens_mistral': 804, 'n_tokens_neox': 795, 'n_words': 154}