Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Commit

Permalink
Adding support for PHP 8 (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jejem committed Jan 29, 2021
1 parent 5fb598a commit a153677
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"authors": [{"name": "Jérémy 'Jejem' Desvages", "email": "jejem@phyrexia.org"}],
"license": "MIT",
"require": {
"php": ">=5.3",
"php": "^5.3 || ^7.0 || ^8.0",
"ext-curl": "*",
"psr/http-message": "^1.0",
"guzzlehttp/psr7": "^1.0"
Expand Down
13 changes: 12 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,19 @@ public function setPostData($postData) {
}

private function parseOutput($ch, $ret) {
if (! is_resource($ch) || ! $ret)
if (! $ret) {
return false;
}

if (\PHP_VERSION_ID < 80000) {
if (! is_resource($ch)) {
return false;
}
} else {
if (! $ch instanceof \CurlHandle) {
return false;
}
}

$headers_size = $this->headersSize;
if (is_numeric($headers_size) && $headers_size > 0) {
Expand Down

0 comments on commit a153677

Please sign in to comment.