wordpress-seo
/
src
/
ai
/
authorization
/
infrastructure
/
code-verifier-user-meta-repository-interface.php
code-verifier-user-meta-repository-interface.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.5, at src/ai/authorization/infrastructure/code-verifier-user-meta-repository-interface.php
| 1 | <?php |
| 2 | |
| 3 | // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure. |
| 4 | |
| 5 | namespace Yoast\WP\SEO\AI\Authorization\Infrastructure; |
| 6 | |
| 7 | use RuntimeException; |
| 8 | use Yoast\WP\SEO\AI\Authorization\Domain\Code_Verifier; |
| 9 | |
| 10 | // phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded |
| 11 | /** |
| 12 | * Interface for the Code Verifier User Meta Repository. |
| 13 | * |
| 14 | * This interface defines methods for managing code verifiers associated with users. |
| 15 | */ |
| 16 | interface Code_Verifier_User_Meta_Repository_Interface { |
| 17 | |
| 18 | /** |
| 19 | * Get the verification code for a user. |
| 20 | * |
| 21 | * @param int $user_id The user ID. |
| 22 | * |
| 23 | * @throws RuntimeException If the code verifier is not found or has expired. |
| 24 | * @return Code_Verifier The verification code or null if not found. |
| 25 | */ |
| 26 | public function get_code_verifier( int $user_id ): ?Code_Verifier; |
| 27 | |
| 28 | /** |
| 29 | * Store the verification code for a user. |
| 30 | * |
| 31 | * @param int $user_id The user ID. |
| 32 | * @param string $code The code verifier. |
| 33 | * @param int $created_at The time the code was created. |
| 34 | * |
| 35 | * @return void |
| 36 | */ |
| 37 | public function store_code_verifier( int $user_id, string $code, int $created_at ): void; |
| 38 | |
| 39 | /** |
| 40 | * Delete the verification code for a user. |
| 41 | * |
| 42 | * @param int $user_id The user ID. |
| 43 | * |
| 44 | * @return void |
| 45 | */ |
| 46 | public function delete_code_verifier( int $user_id ): void; |
| 47 | } |
| 48 | //phpcs:enable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded |
| 49 |