2026-03-05 08:26:51 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MintyPHP\Repository\Auth;
|
|
|
|
|
|
2026-03-13 21:58:51 +01:00
|
|
|
/** Contract for remember-me token creation, rotation, expiry, and active session counting. */
|
2026-03-05 08:26:51 +01:00
|
|
|
interface RememberTokenRepositoryInterface
|
|
|
|
|
{
|
|
|
|
|
public function create(int $userId, string $selector, string $tokenHash, string $expiresAt): ?int;
|
|
|
|
|
|
|
|
|
|
public function findBySelector(string $selector): ?array;
|
|
|
|
|
|
|
|
|
|
public function updateToken(int $id, string $tokenHash, string $expiresAt): bool;
|
|
|
|
|
|
|
|
|
|
public function expireAllByAdmin(): int;
|
|
|
|
|
|
|
|
|
|
public function deleteById(int $id): bool;
|
|
|
|
|
|
|
|
|
|
public function deleteByUserId(int $userId): bool;
|
|
|
|
|
|
|
|
|
|
public function listByUserId(int $userId, int $limit = 20): array;
|
|
|
|
|
|
|
|
|
|
public function countActive(): int;
|
|
|
|
|
}
|