Completed
Push — feature/back-compat-7.5 ( 8bee0f...bb4767 )
by
unknown
166:18 queued 158:13
created

Jetpack_Client   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A remote_request() 0 4 1
A wpcom_json_api_request_as_blog() 0 4 1
1
<?php
2
/**
3
 * Jetpack Client
4
 *
5
 * Deprecated methods for Jetpack to act as client with wpcom, provided for back-compatibility.
6
 *
7
 * @category   Connection
8
 * @package    Client
9
 */
10
11
use Automattic\Jetpack\Connection\Client;
12
13
/**
14
 * Class Jetpack_Client
15
 *
16
 * @deprecated Use Automattic\Jetpack\Connection\Client
17
 */
18
class Jetpack_Client {
19
20
	/**
21
	 * Perform remote request.
22
	 *
23
	 * @deprecated use Automattic\Jetpack\Connection\Client::remote_request
24
	 *
25
	 * @param array $args Arguments.
26
	 * @param null  $body Request body.
27
	 *
28
	 * @return array|WP_Error
29
	 */
30
	public static function remote_request( $args, $body = null ) {
31
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Connection\Client' );
32
		return Client::remote_request( $args, $body );
33
	}
34
35
	/**
36
	 * Request to wpcom using the blog id.
37
	 *
38
	 * @deprecated use Automattic\Jetpack\Connection\Client::wpcom_json_api_request_as_blog
39
	 *
40
	 * @param string $path Endpoint path.
41
	 * @param string $version Endpoint version.
42
	 * @param array  $args Arguments.
43
	 * @param null   $body Request body.
44
	 * @param string $base_api_path Endpoint base prefix.
45
	 *
46
	 * @return Array|WP_Error
47
	 */
48
	public static function wpcom_json_api_request_as_blog( $path, $version, $args, $body, $base_api_path ) {
49
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Connection\Client' );
50
		return Client::wpcom_json_api_request_as_blog( $path, $version, $args, $body, $base_api_path );
51
	}
52
}
53