Renamen and reorganize thirdparty merge files

This commit is contained in:
Julie Lenaerts 2025-02-05 17:08:11 +01:00
parent 3b3659f13f
commit 7c1c1ed800
5 changed files with 13 additions and 18 deletions

View File

@ -51,7 +51,6 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte
$loader->load('services/serializer.yaml'); $loader->load('services/serializer.yaml');
$loader->load('services/repository.yaml'); $loader->load('services/repository.yaml');
$loader->load('services/doctrineEventListener.yaml'); $loader->load('services/doctrineEventListener.yaml');
$loader->load('services/actions.yaml');
} }
public function prepend(ContainerBuilder $container) public function prepend(ContainerBuilder $container)

View File

@ -9,14 +9,14 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * 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 Chill\ThirdPartyBundle\Entity\ThirdParty;
use Doctrine\ORM\EntityManagerInterface; 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 public function merge(ThirdParty $toKeep, ThirdParty $toDelete): void
{ {

View File

@ -1,16 +1,16 @@
<?php <?php
namespace Chill\ThirdPartyBundle\Tests\Action; namespace Chill\ThirdPartyBundle\Tests\Service;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\PersonBundle\Entity\Person\PersonResource; use Chill\PersonBundle\Entity\Person\PersonResource;
use Chill\ThirdPartyBundle\Actions\MergeThirdparty\ThirdpartyMergeManager;
use Chill\ThirdPartyBundle\Entity\ThirdParty; use Chill\ThirdPartyBundle\Entity\ThirdParty;
use Chill\ThirdPartyBundle\Service\ThirdpartyMergeService;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use libphonenumber\PhoneNumber; use libphonenumber\PhoneNumber;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
class ThirdpartyMergeManagerTest extends KernelTestCase class ThirdpartyMergeServiceTest extends KernelTestCase
{ {
private $mergeManager; private $mergeManager;
private $em; private $em;
@ -20,7 +20,7 @@ class ThirdpartyMergeManagerTest extends KernelTestCase
{ {
self::bootKernel(); self::bootKernel();
$this->mergeManager = $this->getContainer()->get(ThirdpartyMergeManager::class); $this->mergeManager = $this->getContainer()->get(ThirdpartyMergeService::class);
$this->em = $this->getContainer()->get(EntityManagerInterface::class); $this->em = $this->getContainer()->get(EntityManagerInterface::class);
$this->connection = $this->em->getConnection(); $this->connection = $this->em->getConnection();

View File

@ -1,14 +1,14 @@
---
services: services:
Chill\ThirdPartyBundle\Serializer\Normalizer\: _defaults:
autowire: true autowire: true
autoconfigure: true
Chill\ThirdPartyBundle\Serializer\Normalizer\:
resource: '../Serializer/Normalizer/' resource: '../Serializer/Normalizer/'
tags: tags:
- { name: 'serializer.normalizer', priority: 64 } - { name: 'serializer.normalizer', priority: 64 }
Chill\ThirdPartyBundle\Export\: Chill\ThirdPartyBundle\Export\:
autowire: true
autoconfigure: true
resource: '../Export/' resource: '../Export/'
Chill\ThirdPartyBundle\Validator\: Chill\ThirdPartyBundle\Validator\:
@ -16,3 +16,5 @@ services:
autowire: true autowire: true
resource: '../Validator/' resource: '../Validator/'
Chill\ThirdPartyBundle\Service\ThirdpartyMergeService: ~

View File

@ -1,6 +0,0 @@
services:
_defaults:
autowire: true
autoconfigure: true
Chill\ThirdPartyBundle\Actions\MergeThirdparty\ThirdpartyMergeManager: ~