Skip to content

Commit a71a7e4

Browse files
committed
Fix "It is recommended not to use reserved keyword "array" as".
1 parent 21f05ac commit a71a7e4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/Response.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ class Response {
2424
*
2525
* @var array<string, mixed>
2626
*/
27-
private $array;
27+
private $data;
2828

2929
/**
3030
* Construct response array.
3131
*
32-
* @param array<string, mixed> $array WordPress remote request response array.
32+
* @param array<string, mixed> $data WordPress remote request response array.
3333
*/
34-
public function __construct( $array ) {
35-
$this->array = $array;
34+
public function __construct( $data ) {
35+
$this->data = $data;
3636
}
3737

3838
/**
@@ -42,7 +42,7 @@ public function __construct( $array ) {
4242
* @return int|string
4343
*/
4444
public function status() {
45-
return \wp_remote_retrieve_response_code( $this->array );
45+
return \wp_remote_retrieve_response_code( $this->data );
4646
}
4747

4848
/**
@@ -52,7 +52,7 @@ public function status() {
5252
* @return string
5353
*/
5454
public function message() {
55-
return \wp_remote_retrieve_response_message( $this->array );
55+
return \wp_remote_retrieve_response_message( $this->data );
5656
}
5757

5858
/**
@@ -62,7 +62,7 @@ public function message() {
6262
* @return string
6363
*/
6464
public function body() {
65-
return \wp_remote_retrieve_body( $this->array );
65+
return \wp_remote_retrieve_body( $this->data );
6666
}
6767

6868
/**
@@ -87,8 +87,8 @@ public function json() {
8787
throw new \Exception(
8888
\sprintf(
8989
'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 ) )
9292
)
9393
);
9494
}
@@ -103,8 +103,8 @@ public function json() {
103103
throw new \Exception(
104104
\sprintf(
105105
'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 ) ),
108108
\esc_html( \strlen( $body ) ),
109109
\esc_html( \json_last_error_msg() )
110110
),
@@ -173,7 +173,7 @@ public function simplexml() {
173173
* @return array<string, mixed>
174174
*/
175175
public function get_array() {
176-
return $this->array;
176+
return $this->data;
177177
}
178178

179179
/**

0 commit comments

Comments
 (0)