| 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 site-level token persistence. |
| 11 |
*/ |
| 12 |
interface Token_Storage_Interface { |
| 13 |
|
| 14 |
/** |
| 15 |
* Retrieves the stored token set. |
| 16 |
* |
| 17 |
* @return Token_Set|null The token set, or null if not stored. |
| 18 |
*/ |
| 19 |
public function get(): ?Token_Set; |
| 20 |
|
| 21 |
/** |
| 22 |
* Stores a token set. |
| 23 |
* |
| 24 |
* @param Token_Set $token_set The token set to store. |
| 25 |
* |
| 26 |
* @return void |
| 27 |
* |
| 28 |
* @throws Token_Storage_Exception If storage fails. |
| 29 |
*/ |
| 30 |
public function store( Token_Set $token_set ): void; |
| 31 |
|
| 32 |
/** |
| 33 |
* Deletes the stored token set. |
| 34 |
* |
| 35 |
* @return void |
| 36 |
*/ |
| 37 |
public function delete(): void; |
| 38 |
} |
| 39 |
|