Fix all the rest of event dispatcher calls

This commit is contained in:
Kamil Kokot 2021-01-13 09:51:11 +01:00
parent a32efb3af0
commit beb414255c
10 changed files with 16 additions and 16 deletions

View file

@ -49,8 +49,8 @@ final class CustomerShowMenuBuilder
$this->addChildren($menu, $customer);
$this->eventDispatcher->dispatch(
self::EVENT_NAME,
new CustomerShowMenuBuilderEvent($this->factory, $menu, $customer)
new CustomerShowMenuBuilderEvent($this->factory, $menu, $customer),
self::EVENT_NAME
);
return $menu;

View file

@ -44,7 +44,7 @@ final class MainMenuBuilder
$this->addMarketingSubMenu($menu);
$this->addConfigurationSubMenu($menu);
$this->eventDispatcher->dispatch(self::EVENT_NAME, new MenuBuilderEvent($this->factory, $menu));
$this->eventDispatcher->dispatch(new MenuBuilderEvent($this->factory, $menu), self::EVENT_NAME);
return $menu;
}

View file

@ -88,8 +88,8 @@ final class OrderShowMenuBuilder
}
$this->eventDispatcher->dispatch(
self::EVENT_NAME,
new OrderShowMenuBuilderEvent($this->factory, $menu, $order, $stateMachine)
new OrderShowMenuBuilderEvent($this->factory, $menu, $order, $stateMachine),
self::EVENT_NAME
);
return $menu;

View file

@ -83,8 +83,8 @@ final class ProductFormMenuBuilder
}
$this->eventDispatcher->dispatch(
self::EVENT_NAME,
new ProductMenuBuilderEvent($this->factory, $menu, $options['product'])
new ProductMenuBuilderEvent($this->factory, $menu, $options['product']),
self::EVENT_NAME
);
return $menu;

View file

@ -89,8 +89,8 @@ final class ProductUpdateMenuBuilder
$menu->addChild($manageVariantsItem);
$this->eventDispatcher->dispatch(
self::EVENT_NAME,
new ProductMenuBuilderEvent($this->factory, $menu, $product)
new ProductMenuBuilderEvent($this->factory, $menu, $product),
self::EVENT_NAME
);
return $menu;

View file

@ -63,8 +63,8 @@ final class ProductVariantFormMenuBuilder
;
$this->eventDispatcher->dispatch(
self::EVENT_NAME,
new ProductVariantMenuBuilderEvent($this->factory, $menu, $options['product_variant'])
new ProductVariantMenuBuilderEvent($this->factory, $menu, $options['product_variant']),
self::EVENT_NAME
);
return $menu;

View file

@ -46,8 +46,8 @@ final class PromotionUpdateMenuBuilder
$this->addChildren($menu, $promotion);
$this->eventDispatcher->dispatch(
self::EVENT_NAME,
new PromotionMenuBuilderEvent($this->factory, $menu, $promotion)
new PromotionMenuBuilderEvent($this->factory, $menu, $promotion),
self::EVENT_NAME
);
return $menu;

View file

@ -48,6 +48,6 @@ final class UserImpersonator implements UserImpersonatorInterface
$this->session->set($this->sessionTokenParameter, serialize($token));
$this->session->save();
$this->eventDispatcher->dispatch(UserEvents::SECURITY_IMPERSONATE, new UserEvent($user));
$this->eventDispatcher->dispatch(new UserEvent($user), UserEvents::SECURITY_IMPERSONATE);
}
}

View file

@ -100,7 +100,7 @@ class OrderController extends ResourceController
$this->eventDispatcher->dispatchPostEvent(ResourceActions::UPDATE, $configuration, $resource);
$this->getEventDispatcher()->dispatch(SyliusCartEvents::CART_CHANGE, new GenericEvent($resource));
$this->getEventDispatcher()->dispatch(new GenericEvent($resource), SyliusCartEvents::CART_CHANGE);
$this->manager->flush();
if (!$configuration->isHtmlRequest()) {

View file

@ -65,7 +65,7 @@ final class AccountMenuBuilder
->setLabelAttribute('icon', 'cart')
;
$this->eventDispatcher->dispatch(self::EVENT_NAME, new MenuBuilderEvent($this->factory, $menu));
$this->eventDispatcher->dispatch(new MenuBuilderEvent($this->factory, $menu), self::EVENT_NAME);
return $menu;
}