From a33a1410e237f5ea1043168c2fd596fdb4973373 Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Wed, 17 Mar 2021 12:54:29 +0100 Subject: [PATCH] Unify service definitions of line items converters --- UPGRADE.md | 8 +++++++- ...sConverter.php => OrderItemUnitLineItemsConverter.php} | 2 +- src/Converter/ShipmentLineItemsConverter.php | 4 ++-- src/Resources/config/services/converter.xml | 4 ++-- src/Resources/config/services/generator.xml | 4 ++-- 5 files changed, 14 insertions(+), 8 deletions(-) rename src/Converter/{LineItemsConverter.php => OrderItemUnitLineItemsConverter.php} (97%) diff --git a/UPGRADE.md b/UPGRADE.md index 81cdc4e65..8fc3d3919 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -7,10 +7,16 @@ 1. The method `Sylius\RefundPlugin\Provider\TaxRateProviderInterface` has been changed from `provide(OrderItemUnitInterface $orderItemUnit): ?string` to `provide(AdjustableInterface $adjustable): ?string`. +1. Service definition for `Sylius\RefundPlugin\Converter\ShipmentLineItemsConverter` has been changed from +`Sylius\RefundPlugin\Converter\ShipmentLineItemsConverterInterface` to `Sylius\RefundPlugin\Converter\ShipmentLineItemsConverter` + +1. `Sylius\RefundPlugin\Converter\LineItemsConverter` has been changed to `Sylius\RefundPlugin\Converter\OrderItemUnitLineItemsConverter` +and its service definition has been changed from `Sylius\RefundPlugin\Converter\LineItemsConverterInterface` to `Sylius\RefundPlugin\Converter\OrderItemUnitLineItemsConverter` + 1. The suffix `Exception` has been removed from classes: * `Sylius\RefundPlugin\Exception\InvalidRefundAmountException` * `Sylius\RefundPlugin\Exception\OrderNotAvailableForRefundingException` - * `Sylius\RefundPlugin\Exception\UnitAlreadyRefundedException` + * `Sylius\RefundPlugin\Exception\UnitAlreadyRefundedException` ### UPGRADE FROM 1.0.0-RC.5 TO 1.0.0-RC.6 diff --git a/src/Converter/LineItemsConverter.php b/src/Converter/OrderItemUnitLineItemsConverter.php similarity index 97% rename from src/Converter/LineItemsConverter.php rename to src/Converter/OrderItemUnitLineItemsConverter.php index 552dcff08..b7b47014c 100644 --- a/src/Converter/LineItemsConverter.php +++ b/src/Converter/OrderItemUnitLineItemsConverter.php @@ -13,7 +13,7 @@ use Sylius\RefundPlugin\Provider\TaxRateProviderInterface; use Webmozart\Assert\Assert; -final class LineItemsConverter implements LineItemsConverterInterface +final class OrderItemUnitLineItemsConverter implements LineItemsConverterInterface { /** @var RepositoryInterface */ private $orderItemUnitRepository; diff --git a/src/Converter/ShipmentLineItemsConverter.php b/src/Converter/ShipmentLineItemsConverter.php index e1da639f8..cb0591d46 100644 --- a/src/Converter/ShipmentLineItemsConverter.php +++ b/src/Converter/ShipmentLineItemsConverter.php @@ -37,13 +37,13 @@ public function convert(array $units): array /** @var ShipmentRefund $shipmentRefund */ foreach ($units as $shipmentRefund) { - $lineItems[] = $this->convertUnitRefundToLineItem($shipmentRefund); + $lineItems[] = $this->convertShipmentRefundToLineItem($shipmentRefund); } return $lineItems; } - private function convertUnitRefundToLineItem(ShipmentRefund $shipmentRefund): LineItemInterface + private function convertShipmentRefundToLineItem(ShipmentRefund $shipmentRefund): LineItemInterface { /** @var AdjustmentInterface|null $shippingAdjustment */ $shippingAdjustment = $this diff --git a/src/Resources/config/services/converter.xml b/src/Resources/config/services/converter.xml index 0f1f8b8b8..91cfeb536 100644 --- a/src/Resources/config/services/converter.xml +++ b/src/Resources/config/services/converter.xml @@ -4,12 +4,12 @@ - + - + diff --git a/src/Resources/config/services/generator.xml b/src/Resources/config/services/generator.xml index 92a33ff5e..ec0dcf7c1 100644 --- a/src/Resources/config/services/generator.xml +++ b/src/Resources/config/services/generator.xml @@ -12,8 +12,8 @@ - - + +