<commit_before><?php

/**
 * Flaming Archer
 *
 * @link      http://github.com/jeremykendall/flaming-archer for the canonical source repository
 * @copyright Copyright (c) 2012 <NAME> (http://about.me/jeremykendall)
 * @license   http://github.com/jeremykendall/flaming-archer/blob/master/LICENSE MIT License
 */

namespace Fa\Dao;

/**
 * User Dao
 */
class UserDao
{

    /**
     * Database connection
     *
     * @var \PDO
     */
    protected $db;

    /**
     * Public constructor
     *
     * @param \PDO Database connection
     */
    public function __construct(\PDO $db)
    {
        $this->db = $db;
    }

    /**
     * Find user by email address
     *
     * @param  string $email User's email address
     * @return array  User record
     */
    public function findByEmail($email)
    {
        $sql = 'SELECT * FROM users WHERE email = :email';
        $stmt = $this->db->prepare($sql);
        $stmt->bindValue(':email', $email, \PDO::PARAM_STR);
        $stmt->execute();
        $user = $stmt->fetch();

        return $user;
    }

    /**
     * Returns all users in the database
     *
     * @return array Users
     */
    public function findAll()
    {
        $sql = 'SELECT * FROM users';

        return $this->db->query($sql)->fetchAll();
    }

    /**
     * Updates login timestamp
     *
     * @param  string $email User's email address
     * @return bool   True on success, false on failure
     */
    public function recordLogin($email)
    {
        $sql = "UPDATE users SET last_login = datetime('now') WHERE email = :email";
        $stmt = $this->db->prepare($sql);

        return $stmt->execute(array('email' => $email));
    }

}<commit_msg>Removes unnecessary whitespace<commit_after><?php

/**
 * Flaming Archer
 *
 * @link      http://github.com/jeremykendall/flaming-archer for the canonical source repository
 * @copyright Copyright (c) 2012 <NAME> (http://about.me/jeremykendall)
 * @license   http://github.com/jeremykendall/flaming-archer/blob/master/LICENSE MIT License
 */

namespace Fa\Dao;

/**
 * User Dao
 */
class UserDao
{
    /**
     * Database connection
     *
     * @var \PDO
     */
    protected $db;

    /**
     * Public constructor
     *
     * @param \PDO Database connection
     */
    public function __construct(\PDO $db)
    {
        $this->db = $db;
    }

    /**
     * Find user by email address
     *
     * @param  string $email User's email address
     * @return array  User record
     */
    public function findByEmail($email)
    {
        $sql = 'SELECT * FROM users WHERE email = :email';
        $stmt = $this->db->prepare($sql);
        $stmt->bindValue(':email', $email, \PDO::PARAM_STR);
        $stmt->execute();
        $user = $stmt->fetch();

        return $user;
    }

    /**
     * Returns all users in the database
     *
     * @return array Users
     */
    public function findAll()
    {
        $sql = 'SELECT * FROM users';

        return $this->db->query($sql)->fetchAll();
    }

    /**
     * Updates login timestamp
     *
     * @param  string $email User's email address
     * @return bool   True on success, false on failure
     */
    public function recordLogin($email)
    {
        $sql = "UPDATE users SET last_login = datetime('now') WHERE email = :email";
        $stmt = $this->db->prepare($sql);

        return $stmt->execute(array('email' => $email));
    }
}
{'fraction_non_alphanumeric': 0.1437371663244353, 'fraction_numerical': 0.0023467292461132297, 'mean_word_length': 2.097184377838329, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7119181', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1036, 'n_words': 264}