From 7c1c1ed800e4395424ddf1410246efacc58158d8 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 5 Feb 2025 17:08:11 +0100 Subject: [PATCH] Renamen and reorganize thirdparty merge files --- .../DependencyInjection/ChillThirdPartyExtension.php | 1 - .../ThirdpartyMergeService.php} | 6 +++--- .../ThirdpartyMergeServiceTest.php} | 8 ++++---- src/Bundle/ChillThirdPartyBundle/config/services.yaml | 10 ++++++---- .../ChillThirdPartyBundle/config/services/actions.yaml | 6 ------ 5 files changed, 13 insertions(+), 18 deletions(-) rename src/Bundle/ChillThirdPartyBundle/{Actions/MergeThirdparty/ThirdpartyMergeManager.php => Service/ThirdpartyMergeService.php} (97%) rename src/Bundle/ChillThirdPartyBundle/Tests/{Action/ThirdpartyMergeManagerTest.php => Service/ThirdpartyMergeServiceTest.php} (94%) delete mode 100644 src/Bundle/ChillThirdPartyBundle/config/services/actions.yaml diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php index e12807819..475d22049 100644 --- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php +++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php @@ -51,7 +51,6 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte $loader->load('services/serializer.yaml'); $loader->load('services/repository.yaml'); $loader->load('services/doctrineEventListener.yaml'); - $loader->load('services/actions.yaml'); } public function prepend(ContainerBuilder $container) diff --git a/src/Bundle/ChillThirdPartyBundle/Actions/MergeThirdparty/ThirdpartyMergeManager.php b/src/Bundle/ChillThirdPartyBundle/Service/ThirdpartyMergeService.php similarity index 97% rename from src/Bundle/ChillThirdPartyBundle/Actions/MergeThirdparty/ThirdpartyMergeManager.php rename to src/Bundle/ChillThirdPartyBundle/Service/ThirdpartyMergeService.php index 941288367..8c4d0e9ef 100644 --- a/src/Bundle/ChillThirdPartyBundle/Actions/MergeThirdparty/ThirdpartyMergeManager.php +++ b/src/Bundle/ChillThirdPartyBundle/Service/ThirdpartyMergeService.php @@ -9,14 +9,14 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ThirdPartyBundle\Actions\MergeThirdparty; +namespace Chill\ThirdPartyBundle\Service; use Chill\ThirdPartyBundle\Entity\ThirdParty; use Doctrine\ORM\EntityManagerInterface; -class ThirdpartyMergeManager +class ThirdpartyMergeService { - public function __construct(private readonly EntityManagerInterface $em, private iterable $handlers) {} + public function __construct(private readonly EntityManagerInterface $em) {} public function merge(ThirdParty $toKeep, ThirdParty $toDelete): void { diff --git a/src/Bundle/ChillThirdPartyBundle/Tests/Action/ThirdpartyMergeManagerTest.php b/src/Bundle/ChillThirdPartyBundle/Tests/Service/ThirdpartyMergeServiceTest.php similarity index 94% rename from src/Bundle/ChillThirdPartyBundle/Tests/Action/ThirdpartyMergeManagerTest.php rename to src/Bundle/ChillThirdPartyBundle/Tests/Service/ThirdpartyMergeServiceTest.php index a36a393bc..de11cea7a 100644 --- a/src/Bundle/ChillThirdPartyBundle/Tests/Action/ThirdpartyMergeManagerTest.php +++ b/src/Bundle/ChillThirdPartyBundle/Tests/Service/ThirdpartyMergeServiceTest.php @@ -1,16 +1,16 @@ mergeManager = $this->getContainer()->get(ThirdpartyMergeManager::class); + $this->mergeManager = $this->getContainer()->get(ThirdpartyMergeService::class); $this->em = $this->getContainer()->get(EntityManagerInterface::class); $this->connection = $this->em->getConnection(); diff --git a/src/Bundle/ChillThirdPartyBundle/config/services.yaml b/src/Bundle/ChillThirdPartyBundle/config/services.yaml index 572026771..ffe3207d3 100644 --- a/src/Bundle/ChillThirdPartyBundle/config/services.yaml +++ b/src/Bundle/ChillThirdPartyBundle/config/services.yaml @@ -1,14 +1,14 @@ ---- services: - Chill\ThirdPartyBundle\Serializer\Normalizer\: + _defaults: autowire: true + autoconfigure: true + + Chill\ThirdPartyBundle\Serializer\Normalizer\: resource: '../Serializer/Normalizer/' tags: - { name: 'serializer.normalizer', priority: 64 } Chill\ThirdPartyBundle\Export\: - autowire: true - autoconfigure: true resource: '../Export/' Chill\ThirdPartyBundle\Validator\: @@ -16,3 +16,5 @@ services: autowire: true resource: '../Validator/' + Chill\ThirdPartyBundle\Service\ThirdpartyMergeService: ~ + diff --git a/src/Bundle/ChillThirdPartyBundle/config/services/actions.yaml b/src/Bundle/ChillThirdPartyBundle/config/services/actions.yaml deleted file mode 100644 index e65ed6600..000000000 --- a/src/Bundle/ChillThirdPartyBundle/config/services/actions.yaml +++ /dev/null @@ -1,6 +0,0 @@ -services: - _defaults: - autowire: true - autoconfigure: true - - Chill\ThirdPartyBundle\Actions\MergeThirdparty\ThirdpartyMergeManager: ~