fix(Timeslots): correct assertion for timeslotList type

Updated the assertion in the constructor to ensure all elements of $timeslotList are instances of PickupTimeSlot.
This commit is contained in:
Jérémy Munsch 2026-11-15 20:11:37 +01:00
parent 6a599b9855
commit afb385fe5d
No known key found for this signature in database
GPG key ID: 2AAECDA6B7330F91

View file

@ -13,9 +13,9 @@ final readonly class GetAvailableTimeslotsQueryOutput
public function __construct(
public array $timeslotList,
) {
Assert::allInArray(
Assert::allIsInstanceOf(
$this->timeslotList,
fn ($value) => $value instanceof PickupTimeSlot,
PickupTimeSlot::class,
'All elements of $timeslotList must be instances of PickupTimeSlot'
);
}