interface UsernameRecoveryRepositoryInterface (View source)

Persistence for username recovery attempts and their rate-limit counters.

Methods

bool
create(array $data)

Record a username recovery request.

int
countRecentAttempts(string $email, int $seconds)

Count recent recovery attempts for an email address.

int
countRecentAttemptsByIp(string $ip, int $seconds)

Count recent recovery attempts by IP address.

int
deleteOlderThan(int $days = 30)

Delete records older than the given number of days.

Details

bool create(array $data)

Record a username recovery request.

Parameters

array $data

Request data containing email and ip_address

Return Value

bool

True if the record was created successfully

int countRecentAttempts(string $email, int $seconds)

Count recent recovery attempts for an email address.

Parameters

string $email
int $seconds

Time window in seconds to check within

Return Value

int

int countRecentAttemptsByIp(string $ip, int $seconds)

Count recent recovery attempts by IP address.

Parameters

string $ip
int $seconds

Time window in seconds to check within

Return Value

int

int deleteOlderThan(int $days = 30)

Delete records older than the given number of days.

Parameters

int $days

Return Value

int

Number of deleted records