From 5859e2b2397607161a69bb7be88df04daac79f80 Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Mon, 31 May 2021 14:57:41 +0200 Subject: [PATCH] Use interfaces instead of FQCN as services ids + minor files refactor --- src/Resources/config/services.xml | 109 ++++-------------- src/Resources/config/services/actions.xml | 14 +-- src/Resources/config/services/checkers.xml | 40 +++++++ src/Resources/config/services/command_bus.xml | 6 +- .../{converter.xml => converters.xml} | 0 src/Resources/config/services/creators.xml | 26 +++++ src/Resources/config/services/event_bus.xml | 8 +- src/Resources/config/services/factories.xml | 34 ++++++ src/Resources/config/services/factory.xml | 25 ---- src/Resources/config/services/generator.xml | 33 ------ src/Resources/config/services/generators.xml | 48 ++++++++ src/Resources/config/services/listeners.xml | 34 ++++++ src/Resources/config/services/provider.xml | 56 --------- src/Resources/config/services/providers.xml | 69 +++++++++++ .../config/services/state_resolvers.xml | 37 ++++++ src/Resources/config/services/validator.xml | 16 --- src/Resources/config/services/validators.xml | 25 ++++ tests/Application/config/services_test.yaml | 4 +- tests/Behat/Resources/services.xml | 2 +- 19 files changed, 353 insertions(+), 233 deletions(-) create mode 100644 src/Resources/config/services/checkers.xml rename src/Resources/config/services/{converter.xml => converters.xml} (100%) create mode 100644 src/Resources/config/services/creators.xml create mode 100644 src/Resources/config/services/factories.xml delete mode 100644 src/Resources/config/services/factory.xml delete mode 100644 src/Resources/config/services/generator.xml create mode 100644 src/Resources/config/services/generators.xml create mode 100644 src/Resources/config/services/listeners.xml delete mode 100644 src/Resources/config/services/provider.xml create mode 100644 src/Resources/config/services/providers.xml create mode 100644 src/Resources/config/services/state_resolvers.xml delete mode 100644 src/Resources/config/services/validator.xml create mode 100644 src/Resources/config/services/validators.xml diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml index 272f6832..1bb3e6e7 100644 --- a/src/Resources/config/services.xml +++ b/src/Resources/config/services.xml @@ -1,122 +1,59 @@ - + - - - - - - - - + + - - - - - - - + + - - - + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Calculator\UnitRefundTotalCalculatorInterface instead. - + + - + - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - @SyliusRefundPlugin/Order/Admin/creditMemos.html.twig - - - - - @SyliusRefundPlugin/Order/Admin/refundPayments.html.twig - - - Sylius\RefundPlugin\Entity\CreditMemoSequence - - + + - - - @SyliusRefundPlugin/Order/Shop/creditMemos.html.twig - + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Sender\CreditMemoEmailSenderInterface instead. - - - - - - - - - - + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\ResponseBuilder\CreditMemoFileResponseBuilderInterface instead. diff --git a/src/Resources/config/services/actions.xml b/src/Resources/config/services/actions.xml index 14129b69..0d09bd26 100644 --- a/src/Resources/config/services/actions.xml +++ b/src/Resources/config/services/actions.xml @@ -5,14 +5,14 @@ - - + + - - - + + + @@ -28,7 +28,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/src/Resources/config/services/checkers.xml b/src/Resources/config/services/checkers.xml new file mode 100644 index 00000000..cedf4f62 --- /dev/null +++ b/src/Resources/config/services/checkers.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Checker\CreditMemoCustomerRelationCheckerInterface instead. + + + + + + + + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Checker\OrderFullyRefundedTotalCheckerInterface instead. + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Checker\UnitRefundingAvailabilityCheckerInterface instead. + + + diff --git a/src/Resources/config/services/command_bus.xml b/src/Resources/config/services/command_bus.xml index b1f53156..6a57d1c5 100644 --- a/src/Resources/config/services/command_bus.xml +++ b/src/Resources/config/services/command_bus.xml @@ -9,12 +9,12 @@ - + - + @@ -23,7 +23,7 @@ - + diff --git a/src/Resources/config/services/converter.xml b/src/Resources/config/services/converters.xml similarity index 100% rename from src/Resources/config/services/converter.xml rename to src/Resources/config/services/converters.xml diff --git a/src/Resources/config/services/creators.xml b/src/Resources/config/services/creators.xml new file mode 100644 index 00000000..e6f298a5 --- /dev/null +++ b/src/Resources/config/services/creators.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Creator\RefundCreatorInterface instead. + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Creator\RefundUnitsCommandCreatorInterface instead. + + + diff --git a/src/Resources/config/services/event_bus.xml b/src/Resources/config/services/event_bus.xml index 2eff99da..ec1eb7d4 100644 --- a/src/Resources/config/services/event_bus.xml +++ b/src/Resources/config/services/event_bus.xml @@ -10,12 +10,12 @@ - + - + @@ -28,9 +28,9 @@ - + - + diff --git a/src/Resources/config/services/factories.xml b/src/Resources/config/services/factories.xml new file mode 100644 index 00000000..7040cf21 --- /dev/null +++ b/src/Resources/config/services/factories.xml @@ -0,0 +1,34 @@ + + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Factory\CreditMemoSequenceFactoryInterface instead. + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Factory\RefundPaymentFactoryInterface instead. + + + + + + + + + + diff --git a/src/Resources/config/services/factory.xml b/src/Resources/config/services/factory.xml deleted file mode 100644 index e63121aa..00000000 --- a/src/Resources/config/services/factory.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/src/Resources/config/services/generator.xml b/src/Resources/config/services/generator.xml deleted file mode 100644 index 1cd02885..00000000 --- a/src/Resources/config/services/generator.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - @SyliusRefundPlugin/Download/creditMemo.html.twig - @SyliusRefundPlugin/Resources/assets/sylius-logo.png - - - - - - - diff --git a/src/Resources/config/services/generators.xml b/src/Resources/config/services/generators.xml new file mode 100644 index 00000000..1a5108bb --- /dev/null +++ b/src/Resources/config/services/generators.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Generator\CreditMemoNumberGeneratorInterface instead. + + + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Generator\CreditMemoGeneratorInterface instead. + + + + + + + + @SyliusRefundPlugin/Download/creditMemo.html.twig + @SyliusRefundPlugin/Resources/assets/sylius-logo.png + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Generator\CreditMemoPdfFileGeneratorInterface instead. + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Generator\CreditMemoIdentifierGeneratorInterface instead. + + + diff --git a/src/Resources/config/services/listeners.xml b/src/Resources/config/services/listeners.xml new file mode 100644 index 00000000..53d92426 --- /dev/null +++ b/src/Resources/config/services/listeners.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + @SyliusRefundPlugin/Order/Shop/creditMemos.html.twig + + + + + @SyliusRefundPlugin/Order/Admin/creditMemos.html.twig + + + + + @SyliusRefundPlugin/Order/Admin/refundPayments.html.twig + + + + diff --git a/src/Resources/config/services/provider.xml b/src/Resources/config/services/provider.xml deleted file mode 100644 index 583e16b3..00000000 --- a/src/Resources/config/services/provider.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - offline - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %sylius_refund.supported_gateways% - - - - - diff --git a/src/Resources/config/services/providers.xml b/src/Resources/config/services/providers.xml new file mode 100644 index 00000000..bb00f649 --- /dev/null +++ b/src/Resources/config/services/providers.xml @@ -0,0 +1,69 @@ + + + + + + offline + + + + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Provider\RefundedShipmentFeeProviderInterface instead. + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Provider\OrderRefundedTotalProviderInterface instead. + + + + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Provider\RemainingTotalProviderInterface instead. + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Provider\UnitRefundedTotalProviderInterface instead. + + + + + + + + + %sylius_refund.supported_gateways% + + + + + diff --git a/src/Resources/config/services/state_resolvers.xml b/src/Resources/config/services/state_resolvers.xml new file mode 100644 index 00000000..656906c6 --- /dev/null +++ b/src/Resources/config/services/state_resolvers.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\StateResolver\OrderFullyRefundedStateResolverInterface instead. + + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\StateResolver\OrderPartiallyRefundedStateResolverInterface instead. + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\StateResolver\RefundPaymentCompletedStateApplierInterface instead. + + + diff --git a/src/Resources/config/services/validator.xml b/src/Resources/config/services/validator.xml deleted file mode 100644 index 17103ed8..00000000 --- a/src/Resources/config/services/validator.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/src/Resources/config/services/validators.xml b/src/Resources/config/services/validators.xml new file mode 100644 index 00000000..59c9703e --- /dev/null +++ b/src/Resources/config/services/validators.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Validator\RefundUnitsCommandValidatorInterface instead. + + + + + + + The "%alias_id%" service alias is deprecated and will be removed in RefundPlugin 1.0, use Sylius\RefundPlugin\Validator\RefundAmountValidatorInterface instead. + + + diff --git a/tests/Application/config/services_test.yaml b/tests/Application/config/services_test.yaml index ca296442..4117f4f1 100644 --- a/tests/Application/config/services_test.yaml +++ b/tests/Application/config/services_test.yaml @@ -4,11 +4,11 @@ imports: services: Tests\Sylius\RefundPlugin\Behat\Services\Generator\FailedCreditMemoGenerator: - decorates: 'Sylius\RefundPlugin\Generator\CreditMemoGenerator' + decorates: 'Sylius\RefundPlugin\Generator\CreditMemoGeneratorInterface' arguments: - '@Tests\Sylius\RefundPlugin\Behat\Services\Generator\FailedCreditMemoGenerator.inner' Tests\Sylius\RefundPlugin\Behat\Services\Factory\FailedRefundPaymentFactory: - decorates: 'Sylius\RefundPlugin\Factory\RefundPaymentFactory' + decorates: 'Sylius\RefundPlugin\Factory\RefundPaymentFactoryInterface' arguments: - '@Tests\Sylius\RefundPlugin\Behat\Services\Factory\FailedRefundPaymentFactory.inner' diff --git a/tests/Behat/Resources/services.xml b/tests/Behat/Resources/services.xml index f53b3710..af4f3d95 100644 --- a/tests/Behat/Resources/services.xml +++ b/tests/Behat/Resources/services.xml @@ -30,7 +30,7 @@ - +