Updated the assertion in the constructor to ensure all elements of $timeslotList are instances of PickupTimeSlot.
22 lines
530 B
PHP
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'
|
|
);
|
|
}
|
|
}
|