PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.2
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.2
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 28.2, at src/ai-http-request/infrastructure/api-client-interface.php

35 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 namespace Yoast\WP\SEO\AI_HTTP_Request\Infrastructure;
4
5 use Exception;
6 use Yoast\WP\SEO\AI_HTTP_Request\Domain\Exceptions\WP_Request_Exception;
7
8 /**
9 * Interface for the API client.
10 */
11
12 interface API_Client_Interface {
13
14 /**
15 * Performs a request to the API.
16 *
17 * @param string $action_path The action path for the request.
18 * @param array<string>|null $body The body of the request, or null/empty to send no body.
19 * @param array<string> $headers The headers for the request.
20 * @param string $http_method The HTTP method for the request. One of `Request::METHOD_*`.
21 *
22 * @return array<int|string|array<string>> The response from the API.
23 *
24 * @throws WP_Request_Exception When the underlying WordPress HTTP call returns an error.
25 */
26 public function perform_request( string $action_path, $body, $headers, string $http_method ): array;
27
28 /**
29 * Gets the timeout of the requests in seconds.
30 *
31 * @return int The timeout of the suggestion requests in seconds.
32 */
33 public function get_request_timeout(): int;
34 }
35