2026-03-05 08:26:51 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MintyPHP\Repository\Auth;
|
|
|
|
|
|
2026-03-13 21:58:51 +01:00
|
|
|
/** Contract for password reset code lifecycle: creation, lookup, attempt tracking, and completion. */
|
2026-03-05 08:26:51 +01:00
|
|
|
interface PasswordResetRepositoryInterface
|
|
|
|
|
{
|
|
|
|
|
public function create(int $userId, string $codeHash, string $expiresAt): ?int;
|
|
|
|
|
|
|
|
|
|
public function invalidateForUser(int $userId): bool;
|
|
|
|
|
|
|
|
|
|
public function findActiveByUserId(int $userId): ?array;
|
|
|
|
|
|
|
|
|
|
public function findById(int $id): ?array;
|
|
|
|
|
|
|
|
|
|
public function incrementAttempts(int $id): bool;
|
|
|
|
|
|
|
|
|
|
public function markUsed(int $id): bool;
|
|
|
|
|
|
|
|
|
|
public function listByUserId(int $userId, int $limit = 20): array;
|
|
|
|
|
}
|