Skip to content

Commit 9a1cc85

Browse files
wb-hx510875yndu13
wb-hx510875
authored andcommitted
deprecated \GuzzleHttp\Psr7\parse_query method
1 parent ce97db8 commit 9a1cc85

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/Request/Request.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ abstract class Request implements ArrayAccess
5454
/**
5555
* Request Connect Timeout
5656
*/
57-
const CONNECT_TIMEOUT = 5;
57+
public const CONNECT_TIMEOUT = 5;
5858

5959
/**
6060
* Request Timeout
6161
*/
62-
const TIMEOUT = 10;
62+
public const TIMEOUT = 10;
6363

6464
/**
6565
* @var string HTTP Method
@@ -317,9 +317,15 @@ public function resolveOption()
317317
$this->resolveParameter();
318318

319319
if (isset($this->options['form_params'])) {
320-
$this->options['form_params'] = \GuzzleHttp\Psr7\parse_query(
321-
Encode::create($this->options['form_params'])->toString()
322-
);
320+
if (function_exists('\GuzzleHttp\Psr7\parse_query')) {
321+
$this->options['form_params'] = \GuzzleHttp\Psr7\parse_query(
322+
Encode::create($this->options['form_params'])->toString()
323+
);
324+
} else {
325+
$this->options['form_params'] = \GuzzleHttp\Psr7\Query::parse(
326+
Encode::create($this->options['form_params'])->toString()
327+
);
328+
}
323329
}
324330

325331
$this->mergeOptionsIntoClient();

0 commit comments

Comments
 (0)