{$constraint->field} ?? null; $comparedValue = $object->{$constraint->comparedTo} ?? null; if ($fieldValue === null || $comparedValue === null) { return; // Skip if either value is null } if (!$fieldValue instanceof \DateTimeInterface || !$comparedValue instanceof \DateTimeInterface) { return; } if ($fieldValue->getTimestamp() >= $comparedValue->getTimestamp()) { $this->context ->buildViolation($constraint->message) ->setParameter('{{ field }}', $constraint->field) ->setParameter('{{ comparedTo }}', $constraint->comparedTo) ->atPath($constraint->field) ->addViolation(); } } }