wip: refactoring
This commit is contained in:
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user