<?php

declare(strict_types=1);

namespace App\Framework\Totp;

/**
 * TOTP Cache Interface
 *
 * Interface for caching used TOTP codes to prevent replay attacks.
 */
interface TotpCache
{
    /**
     * Check if a code has been used
     */
    public function hasUsedCode(string $key): bool;

    /**
     * Mark a code as used
     */
    public function markCodeAsUsed(string $key, int $ttl): void;

    /**
     * Clear expired codes
     */
    public function clearExpired(): int;

    /**
     * Clear all cached codes
     */
    public function clear(): void;

    /**
     * Get cache statistics
     */
    public function getStats(): array;
}
