Airship\Engine\Security\AirBrake::getFailedLoginAttempts PHP Method

getFailedLoginAttempts() public method

Get the number of recent failed login attempts
public getFailedLoginAttempts ( string $username, string $ip ) : integer
$username string
$ip string
return integer
    public function getFailedLoginAttempts(string $username, string $ip) : int
    {
        return (int) $this->db->cell('SELECT
                 count(*)
             FROM
                 airship_failed_logins
             WHERE
                 action = ?
                 AND (
                        username = ?
                     OR subnet = ?
                 )
                 AND occurred > ?
             ', self::ACTION_LOGIN, $username, $this->getSubnet($ip), (new \DateTime())->sub($this->getCutoff((int) ($this->config['expire'] ?? 43200)))->format(\AIRSHIP_DATE_FORMAT));
    }