wip: refactoring

This commit is contained in:
Björn Fromme
2026-03-16 11:59:09 +01:00
parent 2f5b855bae
commit cce1f688b9
14 changed files with 165 additions and 179 deletions
@@ -5,14 +5,12 @@ declare(strict_types=1);
namespace App\Form\Service;
use App\Form\ChoiceLoader\ParticipantRoomChoiceLoader;
use App\Form\DataAdapters\ParticipantDataAdapter;
use App\Form\Model\ParticipantDto;
use App\Form\Model\RoomSelectionDto;
use Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface;
/**
* Factory service for creating ParticipantRoomChoiceLoader instances.
*
* This service provides a clean way to create choice loaders with proper
* dependency injection instead of manually instantiating factories in form types.
*/
class ParticipantRoomChoiceLoaderFactory
{
@@ -23,17 +21,20 @@ class ParticipantRoomChoiceLoaderFactory
/**
* Creates a ParticipantRoomChoiceLoader for the given participant and room data.
*
* @param ParticipantDto[] $allParticipants
* @param RoomSelectionDto[] $selectedRooms
*/
public function createChoiceLoader(
ParticipantDataAdapter $adapter,
public function create(
array $allParticipants,
array $selectedRooms,
int $participantIndex,
): ParticipantRoomChoiceLoader {
return new ParticipantRoomChoiceLoader(
$this->choiceListFactory,
$adapter,
$allParticipants,
$selectedRooms,
$participantIndex
);
}
}
}