PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.8
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.8
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / myyoast-client / application / ports / user-token-storage-interface.php

user-token-storage-interface.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.8, at src/myyoast-client/application/ports/user-token-storage-interface.php

51 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
4 namespace Yoast\WP\SEO\MyYoast_Client\Application\Ports;
5
6 use Yoast\WP\SEO\MyYoast_Client\Application\Exceptions\Token_Storage_Exception;
7 use Yoast\WP\SEO\MyYoast_Client\Domain\Token_Set;
8
9 /**
10 * Port for per-user token persistence.
11 */
12 interface User_Token_Storage_Interface {
13
14 /**
15 * Retrieves the stored token set for a user.
16 *
17 * @param int $user_id The user ID.
18 *
19 * @return Token_Set|null The token set, or null if not stored.
20 */
21 public function get( int $user_id ): ?Token_Set;
22
23 /**
24 * Stores a token set for a user.
25 *
26 * @param int $user_id The user ID.
27 * @param Token_Set $token_set The token set to store.
28 *
29 * @return void
30 *
31 * @throws Token_Storage_Exception If storage fails.
32 */
33 public function store( int $user_id, Token_Set $token_set ): void;
34
35 /**
36 * Deletes the stored token set for a user.
37 *
38 * @param int $user_id The user ID.
39 *
40 * @return void
41 */
42 public function delete( int $user_id ): void;
43
44 /**
45 * Deletes all stored user token sets.
46 *
47 * @return void
48 */
49 public function delete_all(): void;
50 }
51