wip: refactor

This commit is contained in:
Björn Fromme
2025-07-24 11:12:06 +02:00
parent 64d51c01b2
commit 3f94c51bc8
21 changed files with 395 additions and 110 deletions
@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace App\Form\ParticipantFieldHandler\Condition;
use App\Form\Model\BookingCreateDto;
use App\Form\Model\BookingDtoInterface;
/**
* Condition that evaluates participant age against specified range criteria.
@@ -53,15 +53,15 @@ class AgeRangeCondition implements FieldConditionInterface
* checks if it falls within the configured age range. Returns false if
* the participant has no date of birth set.
*
* @param BookingCreateDto $bookingDto The current booking data
* @param BookingDtoInterface $bookingDto The current booking data (create or edit)
* @param int $participantIndex The index of the participant being evaluated
* @param array<string, mixed> $formData Current form data (unused for age conditions)
*
* @return bool True if the participant's age meets the criteria, false otherwise
*/
public function evaluate(BookingCreateDto $bookingDto, int $participantIndex, array $formData): bool
public function evaluate(BookingDtoInterface $bookingDto, int $participantIndex, array $formData): bool
{
$participant = $bookingDto->participants[$participantIndex] ?? null;
$participant = $bookingDto->getParticipant($participantIndex);
if (null === $participant || null === $participant->dateOfBirth) {
return false;