2323namespace Uecode \Bundle \QPushBundle \Provider ;
2424
2525use Aws \Common \Aws ;
26+ use Aws \Sns \SnsClient ;
2627use Aws \Sqs \SqsClient ;
2728use Aws \Sqs \Exception \SqsException ;
2829use Doctrine \Common \Cache \Cache ;
2930use Symfony \Bridge \Monolog \Logger ;
31+ use Symfony \Component \EventDispatcher \EventDispatcherInterface ;
3032use Uecode \Bundle \QPushBundle \Event \Events ;
3133use Uecode \Bundle \QPushBundle \Event \MessageEvent ;
3234use Uecode \Bundle \QPushBundle \Event \NotificationEvent ;
@@ -538,8 +540,11 @@ public function unsubscribeFromTopic($topicArn, $protocol, $endpoint)
538540 * the `{queue}.message_received` event for each message retrieved
539541 *
540542 * @param NotificationEvent $event The Notification Event
543+ * @param string $eventName Name of the event
544+ * @param EventDispatcherInterface $dispatcher
545+ * @return bool|void
541546 */
542- public function onNotification (NotificationEvent $ event )
547+ public function onNotification (NotificationEvent $ event, $ eventName , EventDispatcherInterface $ dispatcher )
543548 {
544549 if (NotificationEvent::TYPE_SUBSCRIPTION == $ event ->getType ()) {
545550 $ topicArn = $ event ->getNotification ()->getMetadata ()->get ('TopicArn ' );
@@ -560,19 +565,20 @@ public function onNotification(NotificationEvent $event)
560565 foreach ($ messages as $ message ) {
561566
562567 $ messageEvent = new MessageEvent ($ this ->name , $ message );
563- $ event -> getDispatcher () ->dispatch (Events::Message ($ this ->name ), $ messageEvent );
568+ $ dispatcher ->dispatch (Events::Message ($ this ->name ), $ messageEvent );
564569 }
565570 }
566571
567572 /**
568573 * Removes the message from queue after all other listeners have fired
569574 *
570- * If an earlier listener has errored or stopped propigation , this method
575+ * If an earlier listener has erred or stopped propagation , this method
571576 * will not fire and the Queued Message should become visible in queue again.
572577 *
573578 * Stops Event Propagation after removing the Message
574579 *
575580 * @param MessageEvent $event The SQS Message Event
581+ * @return bool|void
576582 */
577583 public function onMessageReceived (MessageEvent $ event )
578584 {
0 commit comments