$materials * * @throws InvalidProductionStep */ public function __construct( public ?int $machineId, public int $durationQuarters, public int $workTypeId, public array $materials = [], ) { if ($durationQuarters < 0 || $durationQuarters > self::MAX_QUARTERS || $workTypeId < 1) { throw new InvalidProductionStep; } foreach ($materials as $material) { if ($material['stockItemId'] < 1 || $material['quantityMilli'] < 1) { throw new InvalidProductionStep; } } } }