Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/Model/Response/AbstractResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions src/Service/CommunicationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Loading