diff --git a/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php b/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php index 2739930f5..1f19def23 100644 --- a/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php +++ b/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php @@ -1,5 +1,14 @@ [ ['onKernelTerminate', 1024], // we must ensure that the priority is before sending email - ] + ], ]; } diff --git a/src/Bundle/ChillMainBundle/Notification/NotificationPersister.php b/src/Bundle/ChillMainBundle/Notification/NotificationPersister.php index b8bd132ed..d426e3cd7 100644 --- a/src/Bundle/ChillMainBundle/Notification/NotificationPersister.php +++ b/src/Bundle/ChillMainBundle/Notification/NotificationPersister.php @@ -1,5 +1,14 @@ waitingNotifications[] = $notification; - } - /** * @return array|Notification[] */ @@ -20,4 +24,9 @@ class NotificationPersister implements NotificationPersisterInterface { return $this->waitingNotifications; } + + public function persist(Notification $notification): void + { + $this->waitingNotifications[] = $notification; + } } diff --git a/src/Bundle/ChillMainBundle/Notification/NotificationPersisterInterface.php b/src/Bundle/ChillMainBundle/Notification/NotificationPersisterInterface.php index a87b5f90a..da98e305b 100644 --- a/src/Bundle/ChillMainBundle/Notification/NotificationPersisterInterface.php +++ b/src/Bundle/ChillMainBundle/Notification/NotificationPersisterInterface.php @@ -1,11 +1,20 @@