From ec47d729038b868e4bdb8af439c867d8743db94c Mon Sep 17 00:00:00 2001 From: Michal Dabrowski Date: Wed, 20 Nov 2024 14:13:11 +0100 Subject: [PATCH] cr comments fix --- src/WebPushSender/WebPushSender.php | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/WebPushSender/WebPushSender.php b/src/WebPushSender/WebPushSender.php index 3685214..ecc0014 100644 --- a/src/WebPushSender/WebPushSender.php +++ b/src/WebPushSender/WebPushSender.php @@ -21,8 +21,6 @@ use Sylius\Component\Core\Model\ChannelInterface; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\User\Model\UserInterface; -use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\Translation\TranslatableMessage; use Traversable; final class WebPushSender implements WebPushSenderInterface @@ -36,19 +34,17 @@ final class WebPushSender implements WebPushSenderInterface public const GROUP_RECEIVER = 'group'; public function __construct( - private UserSubscriptionRepositoryInterface $userSubscriptionRepository, - private UserSubscriptionManagerInterface $userSubscriptionManager, - private PushMessageSender $sender, + private UserSubscriptionRepositoryInterface $userSubscriptionRepository, + private UserSubscriptionManagerInterface $userSubscriptionManager, + private PushMessageSender $sender, private PushNotificationTemplateRepositoryInterface $pushNotificationTemplateRepository, - private PushNotificationConfigurationService $pushNotificationConfigurationService, - private WebPushHistoryCreatorInterface $webPushHistoryCreator, - private ChannelContextInterface $channelContext, - private WebPushFactoryInterface $webPushFactory, - private ParameterMapperInterface $orderParameterMapper, - private LoggerInterface $logger, - private SessionInterface $session, - ) - { + private PushNotificationConfigurationService $pushNotificationConfigurationService, + private WebPushHistoryCreatorInterface $webPushHistoryCreator, + private ChannelContextInterface $channelContext, + private WebPushFactoryInterface $webPushFactory, + private ParameterMapperInterface $orderParameterMapper, + private LoggerInterface $logger, + ) { } public function sendWebPush(SendPushNotificationFormModel $sendPushNotificationFormModel): void @@ -106,14 +102,9 @@ public function sendOrderWebPush(OrderInterface $order, string $pushNotification $user->getEmail(), ); } catch (\Exception $e) { - $this->session->getFlashBag()->add( - 'error', - new TranslatableMessage('speardevs_sylius_push_notifications_plugin.ui.sent_error') - ); $this->logger->error('Problem while sending push notifications ' . $e->getMessage()); } } - } private function send(WebPushInterface $webPush, iterable $subscriptions): void