diff --git a/src/Sylius/Bundle/ShopBundle/EventListener/CustomerEmailUpdaterListener.php b/src/Sylius/Bundle/ShopBundle/EventListener/CustomerEmailUpdaterListener.php index a3720e31f0..aabf377a6e 100644 --- a/src/Sylius/Bundle/ShopBundle/EventListener/CustomerEmailUpdaterListener.php +++ b/src/Sylius/Bundle/ShopBundle/EventListener/CustomerEmailUpdaterListener.php @@ -111,7 +111,7 @@ final class CustomerEmailUpdaterListener } if (!$user->isEnabled() && !$user->isVerified() && null !== $user->getEmailVerificationToken()) { - $this->eventDispatcher->dispatch(UserEvents::REQUEST_VERIFICATION_TOKEN, new GenericEvent($user)); + $this->eventDispatcher->dispatch(new GenericEvent($user), UserEvents::REQUEST_VERIFICATION_TOKEN); /** @var FlashBagInterface $flashBag */ $flashBag = $this->session->getBag('flashes'); diff --git a/src/Sylius/Bundle/ShopBundle/EventListener/UserRegistrationListener.php b/src/Sylius/Bundle/ShopBundle/EventListener/UserRegistrationListener.php index 30f2bec07a..dc7875dcac 100644 --- a/src/Sylius/Bundle/ShopBundle/EventListener/UserRegistrationListener.php +++ b/src/Sylius/Bundle/ShopBundle/EventListener/UserRegistrationListener.php @@ -91,7 +91,7 @@ final class UserRegistrationListener $this->userManager->persist($user); $this->userManager->flush(); - $this->eventDispatcher->dispatch(UserEvents::REQUEST_VERIFICATION_TOKEN, new GenericEvent($user)); + $this->eventDispatcher->dispatch(new GenericEvent($user), UserEvents::REQUEST_VERIFICATION_TOKEN); } private function enableAndLogin(ShopUserInterface $user): void diff --git a/src/Sylius/Bundle/ShopBundle/spec/EventListener/CustomerEmailUpdaterListenerSpec.php b/src/Sylius/Bundle/ShopBundle/spec/EventListener/CustomerEmailUpdaterListenerSpec.php index 4d29f4b158..f9eab64d47 100644 --- a/src/Sylius/Bundle/ShopBundle/spec/EventListener/CustomerEmailUpdaterListenerSpec.php +++ b/src/Sylius/Bundle/ShopBundle/spec/EventListener/CustomerEmailUpdaterListenerSpec.php @@ -199,7 +199,7 @@ final class CustomerEmailUpdaterListenerSpec extends ObjectBehavior $flashBag->add('success', 'sylius.user.verify_email_request')->shouldBeCalled(); $eventDispatcher - ->dispatch(UserEvents::REQUEST_VERIFICATION_TOKEN, Argument::type(GenericEvent::class)) + ->dispatch(Argument::type(GenericEvent::class), UserEvents::REQUEST_VERIFICATION_TOKEN) ->shouldBeCalled() ; @@ -234,7 +234,7 @@ final class CustomerEmailUpdaterListenerSpec extends ObjectBehavior $flashBag->add(Argument::any())->shouldNotBeCalled(); $eventDispatcher - ->dispatch(UserEvents::REQUEST_VERIFICATION_TOKEN, Argument::type(GenericEvent::class)) + ->dispatch(Argument::type(GenericEvent::class), UserEvents::REQUEST_VERIFICATION_TOKEN) ->shouldNotBeCalled() ; @@ -269,7 +269,7 @@ final class CustomerEmailUpdaterListenerSpec extends ObjectBehavior $flashBag->add(Argument::any())->shouldNotBeCalled(); $eventDispatcher - ->dispatch(UserEvents::REQUEST_VERIFICATION_TOKEN, Argument::type(GenericEvent::class)) + ->dispatch(Argument::type(GenericEvent::class), UserEvents::REQUEST_VERIFICATION_TOKEN) ->shouldNotBeCalled() ; @@ -304,7 +304,7 @@ final class CustomerEmailUpdaterListenerSpec extends ObjectBehavior $flashBag->add(Argument::any())->shouldNotBeCalled(); $eventDispatcher - ->dispatch(UserEvents::REQUEST_VERIFICATION_TOKEN, Argument::type(GenericEvent::class)) + ->dispatch(Argument::type(GenericEvent::class), UserEvents::REQUEST_VERIFICATION_TOKEN) ->shouldNotBeCalled() ; @@ -335,7 +335,7 @@ final class CustomerEmailUpdaterListenerSpec extends ObjectBehavior $flashBag->add(Argument::any())->shouldNotBeCalled(); $eventDispatcher - ->dispatch(UserEvents::REQUEST_VERIFICATION_TOKEN, Argument::type(GenericEvent::class)) + ->dispatch(Argument::type(GenericEvent::class), UserEvents::REQUEST_VERIFICATION_TOKEN) ->shouldNotBeCalled() ; diff --git a/src/Sylius/Bundle/ShopBundle/spec/EventListener/UserRegistrationListenerSpec.php b/src/Sylius/Bundle/ShopBundle/spec/EventListener/UserRegistrationListenerSpec.php index c1d3f239bf..6f3c0f6d30 100644 --- a/src/Sylius/Bundle/ShopBundle/spec/EventListener/UserRegistrationListenerSpec.php +++ b/src/Sylius/Bundle/ShopBundle/spec/EventListener/UserRegistrationListenerSpec.php @@ -68,7 +68,7 @@ final class UserRegistrationListenerSpec extends ObjectBehavior $userManager->flush()->shouldBeCalled(); $eventDispatcher - ->dispatch(UserEvents::REQUEST_VERIFICATION_TOKEN, Argument::type(GenericEvent::class)) + ->dispatch(Argument::type(GenericEvent::class), UserEvents::REQUEST_VERIFICATION_TOKEN) ->shouldBeCalled() ; @@ -103,7 +103,7 @@ final class UserRegistrationListenerSpec extends ObjectBehavior $user->setEmailVerificationToken(Argument::any())->shouldNotBeCalled(); $eventDispatcher - ->dispatch(UserEvents::REQUEST_VERIFICATION_TOKEN, Argument::type(GenericEvent::class)) + ->dispatch(Argument::type(GenericEvent::class), UserEvents::REQUEST_VERIFICATION_TOKEN) ->shouldNotBeCalled() ; @@ -138,7 +138,7 @@ final class UserRegistrationListenerSpec extends ObjectBehavior $user->setEmailVerificationToken(Argument::any())->shouldNotBeCalled(); $eventDispatcher - ->dispatch(UserEvents::REQUEST_VERIFICATION_TOKEN, Argument::type(GenericEvent::class)) + ->dispatch(Argument::type(GenericEvent::class), UserEvents::REQUEST_VERIFICATION_TOKEN) ->shouldNotBeCalled() ;