From 389a5bc37ee0258a9862feda7ea43d270792f4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Tue, 9 Jun 2026 13:12:04 +0200 Subject: [PATCH 1/3] Added compatibility to PHP 8.5 --- src/Model/Response/AbstractResponse.php | 6 ++---- src/Service/CommunicationService.php | 6 ++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Model/Response/AbstractResponse.php b/src/Model/Response/AbstractResponse.php index c1584c2..2813254 100644 --- a/src/Model/Response/AbstractResponse.php +++ b/src/Model/Response/AbstractResponse.php @@ -76,12 +76,10 @@ abstract class AbstractResponse /** * AbstractResponse constructor. Sets response. - * - * @param \SimpleXmlElement $response */ - public function __construct(\SimpleXmlElement $response = null) + public function __construct($response = null) { - if ($response !== null) { + if ($response !== null && $response instanceof \SimpleXmlElement) { $this->setResponse($response); $this->setStatusCode((string) $this->getResponse()->head->processing->status->attributes()->code); diff --git a/src/Service/CommunicationService.php b/src/Service/CommunicationService.php index b345e19..8f317d3 100644 --- a/src/Service/CommunicationService.php +++ b/src/Service/CommunicationService.php @@ -90,8 +90,10 @@ public function send($xml, $connectionTimeout = 0, $executionTimeout = 0, $retri $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - // close connection - curl_close($ch); + if (version_compare(PHP_VERSION, '8.0.0', '<')) { // curl_close does nothing since 8.0 and is deprecated since 8.5 + // close connection + curl_close($ch); + } // status codes 3xx and 5xx are not processable by the SDK (we assume that the body will be invalid too) $invalidStatusCode = $statusCode < 200 || ($statusCode >= 300 && ($statusCode < 400 || $statusCode >= 500)); From 65cb86b21352fcb01cd0ea4fd7fe40722310a13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Tue, 9 Jun 2026 13:14:40 +0200 Subject: [PATCH 2/3] Revert "Added compatibility to PHP 8.5" This reverts commit 389a5bc37ee0258a9862feda7ea43d270792f4a5. --- src/Model/Response/AbstractResponse.php | 6 ++++-- src/Service/CommunicationService.php | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Model/Response/AbstractResponse.php b/src/Model/Response/AbstractResponse.php index 2813254..c1584c2 100644 --- a/src/Model/Response/AbstractResponse.php +++ b/src/Model/Response/AbstractResponse.php @@ -76,10 +76,12 @@ abstract class AbstractResponse /** * AbstractResponse constructor. Sets response. + * + * @param \SimpleXmlElement $response */ - public function __construct($response = null) + public function __construct(\SimpleXmlElement $response = null) { - if ($response !== null && $response instanceof \SimpleXmlElement) { + if ($response !== null) { $this->setResponse($response); $this->setStatusCode((string) $this->getResponse()->head->processing->status->attributes()->code); diff --git a/src/Service/CommunicationService.php b/src/Service/CommunicationService.php index 8f317d3..b345e19 100644 --- a/src/Service/CommunicationService.php +++ b/src/Service/CommunicationService.php @@ -90,10 +90,8 @@ public function send($xml, $connectionTimeout = 0, $executionTimeout = 0, $retri $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - if (version_compare(PHP_VERSION, '8.0.0', '<')) { // curl_close does nothing since 8.0 and is deprecated since 8.5 - // close connection - curl_close($ch); - } + // close connection + curl_close($ch); // status codes 3xx and 5xx are not processable by the SDK (we assume that the body will be invalid too) $invalidStatusCode = $statusCode < 200 || ($statusCode >= 300 && ($statusCode < 400 || $statusCode >= 500)); From d237552ee3812114d0385c050527dbed675e35b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Tue, 9 Jun 2026 13:16:48 +0200 Subject: [PATCH 3/3] Added compatibility to PHP 8.5 --- src/Model/Response/AbstractResponse.php | 6 ++---- src/Service/CommunicationService.php | 6 ++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Model/Response/AbstractResponse.php b/src/Model/Response/AbstractResponse.php index c1584c2..2813254 100644 --- a/src/Model/Response/AbstractResponse.php +++ b/src/Model/Response/AbstractResponse.php @@ -76,12 +76,10 @@ abstract class AbstractResponse /** * AbstractResponse constructor. Sets response. - * - * @param \SimpleXmlElement $response */ - public function __construct(\SimpleXmlElement $response = null) + public function __construct($response = null) { - if ($response !== null) { + if ($response !== null && $response instanceof \SimpleXmlElement) { $this->setResponse($response); $this->setStatusCode((string) $this->getResponse()->head->processing->status->attributes()->code); diff --git a/src/Service/CommunicationService.php b/src/Service/CommunicationService.php index b345e19..8f317d3 100644 --- a/src/Service/CommunicationService.php +++ b/src/Service/CommunicationService.php @@ -90,8 +90,10 @@ public function send($xml, $connectionTimeout = 0, $executionTimeout = 0, $retri $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - // close connection - curl_close($ch); + if (version_compare(PHP_VERSION, '8.0.0', '<')) { // curl_close does nothing since 8.0 and is deprecated since 8.5 + // close connection + curl_close($ch); + } // status codes 3xx and 5xx are not processable by the SDK (we assume that the body will be invalid too) $invalidStatusCode = $statusCode < 200 || ($statusCode >= 300 && ($statusCode < 400 || $statusCode >= 500));