diff --git a/src/Controller/Webhook/MailjetNewsletterWebhookController.php b/src/Controller/Webhook/MailjetNewsletterWebhookController.php index 1adc8d3..9bebce8 100644 --- a/src/Controller/Webhook/MailjetNewsletterWebhookController.php +++ b/src/Controller/Webhook/MailjetNewsletterWebhookController.php @@ -163,7 +163,12 @@ final class MailjetNewsletterWebhookController extends AbstractController if (true === is_string($value) && '' !== trim($value)) { try { return new \DateTimeImmutable($value); - } catch (\Throwable) { + } catch (\Throwable $e) { + $this->logger->debug('Could not parse event timestamp from Mailjet webhook payload', [ + 'value' => $value, + 'error' => $e->getMessage(), + ]); + return null; } } diff --git a/src/Form/Service/ParticipantDateOfBirthFieldHandler.php b/src/Form/Service/ParticipantDateOfBirthFieldHandler.php index bcff63b..cc84c16 100644 --- a/src/Form/Service/ParticipantDateOfBirthFieldHandler.php +++ b/src/Form/Service/ParticipantDateOfBirthFieldHandler.php @@ -6,6 +6,7 @@ namespace App\Form\Service; use App\Form\Model\BookingDto; use App\Form\Service\Abstract\AbstractParticipantFieldHandler; +use Psr\Log\LoggerInterface; /** * Handles processing of the dateOfBirth field for booking participants. @@ -21,10 +22,14 @@ use App\Form\Service\Abstract\AbstractParticipantFieldHandler; * - Handles empty selections (converting them to null) * - Updates the participant's dateOfBirth property * - * Dependencies: None (this is a base field that other handlers may depend on) + * Dependencies: Other handlers may depend on this field being processed first (age-based visibility). */ class ParticipantDateOfBirthFieldHandler extends AbstractParticipantFieldHandler { + public function __construct(private readonly LoggerInterface $logger) + { + } + /** * Returns the form field name this handler processes. * @@ -118,7 +123,11 @@ class ParticipantDateOfBirthFieldHandler extends AbstractParticipantFieldHandler return new \DateTimeImmutable($dateString); } catch (\Exception $e) { - // Invalid date components (e.g., Feb 31, invalid year) + $this->logger->debug('Invalid date of birth components submitted', [ + 'date_string' => $dateString, + 'error' => $e->getMessage(), + ]); + return null; } } @@ -138,7 +147,10 @@ class ParticipantDateOfBirthFieldHandler extends AbstractParticipantFieldHandler try { return new \DateTimeImmutable($value); } catch (\Exception $e) { - // Invalid date format, return null + $this->logger->debug('Invalid date of birth string submitted', [ + 'error' => $e->getMessage(), + ]); + return null; } }