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 / ai / http-request / infrastructure / api-client-interface.php

api-client-interface.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.8, at src/ai/http-request/infrastructure/api-client-interface.php

37 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4
5 namespace Yoast\WP\SEO\AI\HTTP_Request\Infrastructure;
6
7 use Exception;
8 use Yoast\WP\SEO\AI\HTTP_Request\Domain\Exceptions\WP_Request_Exception;
9
10 /**
11 * Interface for the API client.
12 */
13
14 interface API_Client_Interface {
15
16 /**
17 * Performs a request to the API.
18 *
19 * @param string $action_path The action path for the request.
20 * @param array<string> $body The body of the request.
21 * @param array<string> $headers The headers for the request.
22 * @param bool $is_post Whether the request is a POST request.
23 *
24 * @return array<int|string|array<string>> The response from the API.
25 *
26 * @throws WP_Request_Exception When the wp_remote_post() returns an error.
27 */
28 public function perform_request( string $action_path, $body, $headers, bool $is_post ): array;
29
30 /**
31 * Gets the timeout of the requests in seconds.
32 *
33 * @return int The timeout of the suggestion requests in seconds.
34 */
35 public function get_request_timeout(): int;
36 }
37