$formData Current form data (unused for this condition) * * @return bool True if the participant has provided their date of birth, false otherwise */ public function evaluate(BookingDto $bookingDto, int $participantIndex, array $formData): bool { $participant = $bookingDto->getParticipant($participantIndex); $result = null !== $participant && null !== $participant->dateOfBirth; error_log(sprintf('[DOB Condition] Participant %d: dateOfBirth=%s, result=%s', $participantIndex, $participant?->dateOfBirth?->format('Y-m-d') ?? 'NULL', $result ? 'TRUE' : 'FALSE' )); return $result; } /** * Returns field names that this condition depends on. * * The date of birth condition depends on the participant's dateOfBirth field. * When this field changes, any conditions based on birth date availability * should be re-evaluated. * * @return string[] Array containing 'dateOfBirth' field name */ public function getDependentFields(): array { return ['dateOfBirth']; } /** * Returns a human-readable description of this condition. * * Provides a clear description of what this condition checks for, * useful for debugging and understanding field state logic. * * @return string Description of the date of birth requirement */ public function getDescription(): string { return 'Participant must provide their date of birth'; } }