From ca9d93eee4d4a9e48dfeaabc3c14fee71a3fdc78 Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Thu, 16 Sep 2021 09:10:05 +0200 Subject: [PATCH] [LineItem] Revert changing return type of invoice --- UPGRADE.md | 5 ----- src/Entity/LineItem.php | 4 ++-- src/Entity/LineItemInterface.php | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 0c9174d6..cc00476d 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,8 +1,3 @@ -### UPGRADE FROM 0.18.0 TO 0.19.0 - -1. The return type of `Sylius\InvoicingPlugin\Entity\LineItemInterface:invoice` method has been changed - from `InvoiceInterface` to `?InvoiceInterface` - ### UPGRADE FROM 0.17.0 TO 0.18.0 1. The `Sylius\InvoicingPlugin\Converter\BillingDataConverter` has been removed in favor of `Sylius\InvoicingPlugin\Factory\BillingDataFactory->createFromAddress`. diff --git a/src/Entity/LineItem.php b/src/Entity/LineItem.php index e06c14c5..11ea3193 100644 --- a/src/Entity/LineItem.php +++ b/src/Entity/LineItem.php @@ -22,7 +22,7 @@ class LineItem implements LineItemInterface, ResourceInterface /** @var mixed */ protected $id; - protected ?InvoiceInterface $invoice = null; + protected InvoiceInterface $invoice; protected string $name; @@ -74,7 +74,7 @@ public function id() return $this->id; } - public function invoice(): ?InvoiceInterface + public function invoice(): InvoiceInterface { return $this->invoice; } diff --git a/src/Entity/LineItemInterface.php b/src/Entity/LineItemInterface.php index ca3ca5fb..4e586e1f 100644 --- a/src/Entity/LineItemInterface.php +++ b/src/Entity/LineItemInterface.php @@ -17,7 +17,7 @@ interface LineItemInterface { public function id(); - public function invoice(): ?InvoiceInterface; + public function invoice(): InvoiceInterface; public function setInvoice(InvoiceInterface $invoice): void;