From 6ee09c90e4264e0a24a6b810b7812a0da36857cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Forg=C3=A1=C4=8D?= Date: Sat, 25 Mar 2023 21:27:25 +0100 Subject: [PATCH 1/2] fix warning Creation of dynamic property PHP 8.2. --- src/Entity/PackagingType.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Entity/PackagingType.php b/src/Entity/PackagingType.php index afa51483..af9aa1e9 100644 --- a/src/Entity/PackagingType.php +++ b/src/Entity/PackagingType.php @@ -65,11 +65,17 @@ class PackagingType implements NodeInterface */ private $code = self::PT_UNKNOWN; + /** @deprecated */ + private $Code = self::PT_UNKNOWN; + /** * @var string */ private $description; + /** @deprecated */ + private $Description; + public function __construct($attributes = null) { if (isset($attributes->Description)) { From c3ccaea774aba0a7ad30491e08808560654a5af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Forg=C3=A1=C4=8D?= Date: Mon, 17 Apr 2023 11:21:12 +0200 Subject: [PATCH 2/2] PHP 8.2. compatibility (no warnings) --- src/Entity/PackagingType.php | 2 +- src/Entity/PickupType.php | 2 +- src/Entity/Service.php | 2 +- src/Entity/ShipFrom.php | 2 +- src/Entity/ShipTo.php | 4 ++-- src/Entity/ShipmentIndicationType.php | 2 +- src/Entity/UnitOfMeasurement.php | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Entity/PackagingType.php b/src/Entity/PackagingType.php index af9aa1e9..4b69d73f 100644 --- a/src/Entity/PackagingType.php +++ b/src/Entity/PackagingType.php @@ -99,7 +99,7 @@ public function toNode(DOMDocument $document = null) $node = $document->createElement('PackagingType'); $node->appendChild($document->createElement('Code', $this->getCode())); - $node->appendChild($document->createElement('Description', $this->getDescription())); + $node->appendChild($document->createElement('Description', $this->getDescription() ?? '')); return $node; } diff --git a/src/Entity/PickupType.php b/src/Entity/PickupType.php index e0f42582..6ad0ea16 100644 --- a/src/Entity/PickupType.php +++ b/src/Entity/PickupType.php @@ -43,7 +43,7 @@ public function toNode(DOMDocument $document = null) $node = $document->createElement('PickupType'); $node->appendChild($document->createElement('Code', $this->getCode())); - $node->appendChild($document->createElement('Description', $this->getDescription())); + $node->appendChild($document->createElement('Description', $this->getDescription() ?? '')); return $node; } diff --git a/src/Entity/Service.php b/src/Entity/Service.php index 137753d7..5bdb231d 100644 --- a/src/Entity/Service.php +++ b/src/Entity/Service.php @@ -157,7 +157,7 @@ public function toNode(DOMDocument $document = null) $node = $document->createElement('Service'); $node->appendChild($document->createElement('Code', $this->getCode())); - $node->appendChild($document->createElement('Description', $this->getDescription())); + $node->appendChild($document->createElement('Description', $this->getDescription() ?? '')); return $node; } diff --git a/src/Entity/ShipFrom.php b/src/Entity/ShipFrom.php index a192b518..0419b029 100644 --- a/src/Entity/ShipFrom.php +++ b/src/Entity/ShipFrom.php @@ -22,7 +22,7 @@ public function toNode(DOMDocument $document = null) $node = $document->createElement('ShipFrom'); if ($this->getCompanyName()) { - $node->appendChild($document->createElement('CompanyName', $this->getCompanyName())); + $node->appendChild($document->createElement('CompanyName', $this->getCompanyName() ?? '')); } if ($this->getAttentionName()) { diff --git a/src/Entity/ShipTo.php b/src/Entity/ShipTo.php index f2330cb1..98629862 100644 --- a/src/Entity/ShipTo.php +++ b/src/Entity/ShipTo.php @@ -142,8 +142,8 @@ public function toNode(DOMDocument $document = null) } $node = $document->createElement('ShipTo'); - $node->appendChild($document->createElement('CompanyName', $this->getCompanyName())); - $node->appendChild($document->createElement('AttentionName', $this->getAttentionName())); + $node->appendChild($document->createElement('CompanyName', $this->getCompanyName() ?? '')); + $node->appendChild($document->createElement('AttentionName', $this->getAttentionName() ?? '')); $address = $this->getAddress(); if (isset($address)) { diff --git a/src/Entity/ShipmentIndicationType.php b/src/Entity/ShipmentIndicationType.php index be438ac9..3b868ec0 100644 --- a/src/Entity/ShipmentIndicationType.php +++ b/src/Entity/ShipmentIndicationType.php @@ -40,7 +40,7 @@ public function toNode(DOMDocument $document = null) $node->appendChild($document->createElement('Code', $this->getCode())); if ($this->getDescription()) { - $node->appendChild($document->createElement('Description', $this->getDescription())); + $node->appendChild($document->createElement('Description', $this->getDescription() ?? '')); } return $node; diff --git a/src/Entity/UnitOfMeasurement.php b/src/Entity/UnitOfMeasurement.php index eb04d176..94f1ae2b 100644 --- a/src/Entity/UnitOfMeasurement.php +++ b/src/Entity/UnitOfMeasurement.php @@ -102,7 +102,7 @@ public function toNode(DOMDocument $document = null) if (null !== $document) { $node = $document->createElement('UnitOfMeasurement'); $node->appendChild($document->createElement('Code', $this->getCode())); - $node->appendChild($document->createElement('Description', $this->getDescription())); + $node->appendChild($document->createElement('Description', $this->getDescription() ?? '')); return $node; }