| 1 |
<?php |
| 2 |
/** |
| 3 |
* Remote API: Interface |
| 4 |
* |
| 5 |
* @package Parsely |
| 6 |
* @since 3.2.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
declare(strict_types=1); |
| 10 |
|
| 11 |
namespace Parsely\RemoteAPI; |
| 12 |
|
| 13 |
use WP_Error; |
| 14 |
|
| 15 |
/** |
| 16 |
* Remote API Interface. |
| 17 |
*/ |
| 18 |
interface Remote_API_Interface { |
| 19 |
/** |
| 20 |
* Returns the items provided by this interface. |
| 21 |
* |
| 22 |
* @param array<string, mixed> $query The query arguments to send to the remote API. |
| 23 |
* @param bool $associative (optional) When TRUE, returned objects will be converted into |
| 24 |
* associative arrays. |
| 25 |
* @return array<string, mixed>|object|WP_Error |
| 26 |
*/ |
| 27 |
public function get_items( array $query, bool $associative = false ); |
| 28 |
|
| 29 |
/** |
| 30 |
* Returns whether the endpoint is available for access by the current |
| 31 |
* user. |
| 32 |
* |
| 33 |
* @since 3.14.0 Renamed from `is_user_allowed_to_make_api_call()`. |
| 34 |
* |
| 35 |
* @return bool |
| 36 |
*/ |
| 37 |
public function is_available_to_current_user(): bool; |
| 38 |
} |
| 39 |
|