ldc-cocotte/app/Cqs/Queries/Timeslots/GetAvailableTimeslotsQueryOutput.php
Jérémy Munsch afb385fe5d
fix(Timeslots): correct assertion for timeslotList type
Updated the assertion in the constructor to ensure all elements of $timeslotList are instances of PickupTimeSlot.
2026-11-15 20:11:37 +01:00

22 lines
530 B
PHP

<?php
declare(strict_types=1);
namespace App\Cqs\Queries\Timeslots;
use Domain\Models\ValueObjects\PickupTimeSlot;
use Webmozart\Assert\Assert;
final readonly class GetAvailableTimeslotsQueryOutput
{
/** @param PickupTimeSlot[] $timeslotList */
public function __construct(
public array $timeslotList,
) {
Assert::allIsInstanceOf(
$this->timeslotList,
PickupTimeSlot::class,
'All elements of $timeslotList must be instances of PickupTimeSlot'
);
}
}