ShopApiPlugin
ShopApiPlugin copied to clipboard
[RFC] AssignCustomerToCartHandler is stateful
https://github.com/Sylius/ShopApiPlugin/blob/3ace12724f53c330d6b894fe2bbe639ecc140d76/src/Handler/Cart/AssignCustomerToCartHandler.php#L42
AssignCustomerToCartHandler uses ShopUserAwareCustomerProvider, which uses loggedInShopUserProvider.
That makes AssignCustomerToCartHandler stateful by depending to currently logged in user.
I think this is not optimal and should be avoided the same way as channel/locale/currency contexts are not used in handlers directly.
Yeah you are right. This should be a part of the command itself.