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

Email 1 - Address class #6629

Closed
wants to merge 2 commits into from
Closed

Conversation

distantnative
Copy link
Member

@distantnative distantnative commented Aug 18, 2024

Description

Summary of changes

  • Added new Email\Address class that handles all address parsing and resolving for from, to, bcc, cc, replyTo
  • Removed deprecated ::clone() method

Reasoning

  • First step in trying to untangle and modernize the email classes
  • Trying to keep it without breaking changes yet

Changelog

Removed deprecated code

  • Email\Email::clone()

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and CI checks all pass

For review team

  • Add changes & docs to release notes draft in Notion

@distantnative distantnative self-assigned this Aug 18, 2024
@distantnative distantnative mentioned this pull request Aug 18, 2024
9 tasks
@distantnative distantnative added the type: refactoring ♻️ Is about bad code; cleans up code label Aug 18, 2024
@distantnative distantnative marked this pull request as ready for review August 18, 2024 17:16
@distantnative distantnative requested a review from a team August 18, 2024 17:16
@distantnative distantnative added this to the 5.0.0-alpha.3 milestone Aug 18, 2024
* Returns one or multiple addresses as array
* where the emails are the keys and the names the values
*/
public static function resolve(array|Address $address): array
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think array usage that doesn't includes Address object is invalid:

// single
Address::resolve(['[email protected]']);

// multiple
Address::resolve([
  '[email protected]' => null,
  '[email protected]'  => 'Lisa Simpson'
]);

If array items are should to be Address objects, it would be nice to have a type check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make the method description more explicit. It is only meant to resolve Address objects and arrays of Address objects. There should be no need to support other formats.

Copy link
Member

@afbora afbora Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conversation is resolved but I couldn't see any changes?

@distantnative
Copy link
Member Author

Closing this for a moment, so we can better focus on some bugs

@distantnative distantnative removed this from the 5.0.0-alpha.3 milestone Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactoring ♻️ Is about bad code; cleans up code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants