public function getAccountRecoveryAttempts(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_RECOVER, $username, $this->getSubnet($ip), (new \DateTime())->sub($this->getCutoff((int) ($this->config['expire'] ?? 43200)))->format(\AIRSHIP_DATE_FORMAT));
}