ldc-boutique-cnc-sable/app/Queries/Timeslots/GetAvailableTimeslotsQueryOutput.php

23 lines
547 B
PHP
Raw Permalink Normal View History

<?php
declare(strict_types=1);
namespace App\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::allInArray(
$this->timeslotList,
fn ($value) => $value instanceof PickupTimeSlot,
'All elements of $timeslotList must be instances of PickupTimeSlot'
);
}
}