Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2/**
3 * WP.com request client interface.
4 *
5 * @package automattic/jetpack-help-center
6 */
7
8namespace Automattic\Jetpack\Help_Center;
9
10/**
11 * Sends requests to the WordPress.com API.
12 */
13interface Wpcom_Request_Client {
14    /**
15     * Whether the current user can make authenticated WordPress.com requests.
16     *
17     * @return bool
18     */
19    public function is_user_connected();
20
21    /**
22     * Send a request to WordPress.com.
23     *
24     * Implementations should authenticate the request as the current user when
25     * possible and send it anonymously when the user is logged out.
26     *
27     * @param string            $path          REST API path.
28     * @param string            $version       REST API version.
29     * @param array             $args          Arguments passed to WP_Http.
30     * @param array|string|null $body          Request body.
31     * @param string            $base_api_path REST API root.
32     *
33     * @return array|\WP_Error Response data, or WP_Error on failure.
34     */
35    public function request(
36        $path,
37        $version = '2',
38        $args = array(),
39        $body = null,
40        $base_api_path = 'wpcom'
41    );
42}