From 4b9575488013aa30785e57bc1c97dfe2c5e2d646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Pereira?= <4070684+mariopereira@users.noreply.github.com> Date: Wed, 19 Jul 2023 11:46:22 +0100 Subject: [PATCH] Fix AbstractXml destructor emiting a warning Solve issue #36 of forked project --- src/service/ShippingService/entity/AbstractXml.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/service/ShippingService/entity/AbstractXml.php b/src/service/ShippingService/entity/AbstractXml.php index 3ba274a..32cf326 100644 --- a/src/service/ShippingService/entity/AbstractXml.php +++ b/src/service/ShippingService/entity/AbstractXml.php @@ -24,7 +24,6 @@ abstract class AbstractXml */ public function __construct() { - $this->xml = new MyXMLWriter(); $this->xml->openMemory(); $this->xml->setIndent(true); @@ -35,10 +34,13 @@ public function __construct() */ public function __destruct() { + set_error_handler(function() {}); if($this->xml instanceof MyXMLWriter) { $this->xml->flush(); } + + restore_error_handler(); } /**