Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] AssignCustomerToCartHandler is stateful #666

Open
diimpp opened this issue Jul 28, 2020 · 1 comment
Open

[RFC] AssignCustomerToCartHandler is stateful #666

diimpp opened this issue Jul 28, 2020 · 1 comment

Comments

@diimpp
Copy link
Member

diimpp commented Jul 28, 2020

$customer = $this->customerProvider->provide($assignOrderToCustomer->email());

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.

@mamazu
Copy link
Member

mamazu commented Jul 29, 2020

Yeah you are right. This should be a part of the command itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants