Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit cd6c610

Browse files
klimserweierophinney
authored andcommitted
Fix for timeout config parameter validation
1 parent e70ed2a commit cd6c610

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Client/Adapter/Curl.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function connect($host, $port = 80, $secure = false)
209209
$connectTimeout = null;
210210
}
211211

212-
if ($connectTimeout !== null && (! is_int($connectTimeout) || ! is_numeric($connectTimeout))) {
212+
if ($connectTimeout !== null && !is_int($connectTimeout) && !is_numeric($connectTimeout)) {
213213
throw new AdapterException\InvalidArgumentException(sprintf(
214214
'integer or numeric string expected, got %s',
215215
gettype($connectTimeout)

src/Client/Adapter/Socket.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function connect($host, $port = 80, $secure = false)
263263
$connectTimeout = $this->config['timeout'];
264264
}
265265

266-
if ($connectTimeout !== null && (! is_int($connectTimeout) || ! is_numeric($connectTimeout))) {
266+
if ($connectTimeout !== null && !is_int($connectTimeout) && !is_numeric($connectTimeout)) {
267267
throw new AdapterException\InvalidArgumentException(sprintf(
268268
'integer or numeric string expected, got %s',
269269
gettype($connectTimeout)

0 commit comments

Comments
 (0)