@@ -24,15 +24,15 @@ class Response {
24
24
*
25
25
* @var array<string, mixed>
26
26
*/
27
- private $ array ;
27
+ private $ data ;
28
28
29
29
/**
30
30
* Construct response array.
31
31
*
32
- * @param array<string, mixed> $array WordPress remote request response array.
32
+ * @param array<string, mixed> $data WordPress remote request response array.
33
33
*/
34
- public function __construct ( $ array ) {
35
- $ this ->array = $ array ;
34
+ public function __construct ( $ data ) {
35
+ $ this ->data = $ data ;
36
36
}
37
37
38
38
/**
@@ -42,7 +42,7 @@ public function __construct( $array ) {
42
42
* @return int|string
43
43
*/
44
44
public function status () {
45
- return \wp_remote_retrieve_response_code ( $ this ->array );
45
+ return \wp_remote_retrieve_response_code ( $ this ->data );
46
46
}
47
47
48
48
/**
@@ -52,7 +52,7 @@ public function status() {
52
52
* @return string
53
53
*/
54
54
public function message () {
55
- return \wp_remote_retrieve_response_message ( $ this ->array );
55
+ return \wp_remote_retrieve_response_message ( $ this ->data );
56
56
}
57
57
58
58
/**
@@ -62,7 +62,7 @@ public function message() {
62
62
* @return string
63
63
*/
64
64
public function body () {
65
- return \wp_remote_retrieve_body ( $ this ->array );
65
+ return \wp_remote_retrieve_body ( $ this ->data );
66
66
}
67
67
68
68
/**
@@ -87,8 +87,8 @@ public function json() {
87
87
throw new \Exception (
88
88
\sprintf (
89
89
'Response is empty, HTTP response: "%s %s". ' ,
90
- \esc_html ( \wp_remote_retrieve_response_code ( $ this ->array ) ),
91
- \esc_html ( \wp_remote_retrieve_response_message ( $ this ->array ) )
90
+ \esc_html ( \wp_remote_retrieve_response_code ( $ this ->data ) ),
91
+ \esc_html ( \wp_remote_retrieve_response_message ( $ this ->data ) )
92
92
)
93
93
);
94
94
}
@@ -103,8 +103,8 @@ public function json() {
103
103
throw new \Exception (
104
104
\sprintf (
105
105
'Could not JSON decode response, HTTP response: "%s %s", HTTP body length: "%d", JSON error: "%s". ' ,
106
- \esc_html ( \wp_remote_retrieve_response_code ( $ this ->array ) ),
107
- \esc_html ( \wp_remote_retrieve_response_message ( $ this ->array ) ),
106
+ \esc_html ( \wp_remote_retrieve_response_code ( $ this ->data ) ),
107
+ \esc_html ( \wp_remote_retrieve_response_message ( $ this ->data ) ),
108
108
\esc_html ( \strlen ( $ body ) ),
109
109
\esc_html ( \json_last_error_msg () )
110
110
),
@@ -173,7 +173,7 @@ public function simplexml() {
173
173
* @return array<string, mixed>
174
174
*/
175
175
public function get_array () {
176
- return $ this ->array ;
176
+ return $ this ->data ;
177
177
}
178
178
179
179
/**
0 commit comments