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

Dispatch events after default is successfully set #3692

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

quisse
Copy link
Contributor

@quisse quisse commented May 2, 2024

1. Why is this change necessary?

To be able to trigger actions based on default addresses successes

2. What does this change do, exactly?

Add some events

3. Describe each step to reproduce the issue or behaviour.

4. Please link to the relevant issues (if any).

#3439

5. Checklist

  • I have rebased my changes to remove merge conflicts
  • I have written tests and verified that they fail without my change
  • I have created a changelog file with all necessary information about my changes
  • I have written or adjusted the documentation according to my changes
  • This change has comments for package types, values, functions, and non-obvious lines of code
  • I have read the contribution requirements and fulfil them.

@CLAassistant
Copy link

CLAassistant commented May 2, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented May 2, 2024

Warnings
⚠️ The Pull Request doesn't contain any changelog file

@quisse quisse force-pushed the Missing-event-on-customer-default-address-swap-success-3439 branch 2 times, most recently from 9a02ce1 to cc1cee2 Compare May 2, 2024 08:31
@quisse quisse force-pushed the Missing-event-on-customer-default-address-swap-success-3439 branch from cc1cee2 to 71f8724 Compare May 2, 2024 08:41
@mstegmeyer
Copy link
Contributor

Could you change the names of these events? We try to avoid Set due to it being close of "a set of things" / a collection.
Maybe do Switched just like the Route or Changed?

Also: just a code style choice: instead of that rather large switch, maybe do a match? Something like this:

$event = match($type) {
    self::BILLING => new BillingEvent(),
    default => new ShippingEvent(),
};
$this->eventDispatcher->dispatch($event);

@mstegmeyer mstegmeyer self-assigned this May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants