Skip to content

Commit

Permalink
Fix AbstractXml destructor emiting a warning
Browse files Browse the repository at this point in the history
Solve issue 200MPH#36 of forked project
  • Loading branch information
mariopereira authored Jul 19, 2023
1 parent 195a6ed commit 4b95754
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/service/ShippingService/entity/AbstractXml.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ abstract class AbstractXml
*/
public function __construct()
{

$this->xml = new MyXMLWriter();
$this->xml->openMemory();
$this->xml->setIndent(true);
Expand All @@ -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();
}

/**
Expand Down

0 comments on commit 4b95754

Please sign in to comment.