From 1675aabc04d2f8c37deab1cc2c6c9399dde7eeb5 Mon Sep 17 00:00:00 2001 From: PhilippeOuellet Date: Fri, 16 Jun 2023 11:14:22 -0400 Subject: [PATCH 1/2] newer version of php deprecated null values when a int type is declared --- src/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index ca58357..c753553 100644 --- a/src/Client.php +++ b/src/Client.php @@ -449,7 +449,7 @@ private function deliverResponses(string $message) public static function onError($level, $message, $file, $line) { $message = trim($message); - $code = null; + $code = 0; throw new ErrorException($message, $code, $level, $file, $line); } From 478bdaa4b15a9e317480f1471f6819fcf9f5574f Mon Sep 17 00:00:00 2001 From: philippeouellet Date: Wed, 24 Apr 2024 13:05:26 -0400 Subject: [PATCH 2/2] Use $http_response_header variable only if it is present --- src/Client.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index c753553..71fc619 100644 --- a/src/Client.php +++ b/src/Client.php @@ -226,7 +226,9 @@ public function send() $this->throwHttpExceptionOnHttpError($http_response_header); $this->deliverResponses($message); } catch (ErrorException $exception) { - $this->throwHttpExceptionOnHttpError($http_response_header); + if (isset($http_response_header)) { + $this->throwHttpExceptionOnHttpError($http_response_header); + } throw $exception; } finally { restore_error_handler();