Skip to content

Conversation

@albertcht
Copy link
Member

No description provided.

@albertcht albertcht added the enhancement Improved feature or adjustments. label Nov 28, 2025
@albertcht albertcht requested a review from Copilot November 28, 2025 17:20
Copilot finished reviewing on behalf of albertcht November 28, 2025 17:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds queue() and later() methods to the PendingMail class to enable queuing mail messages when using the pending mail fluent interface, and updates the Mailable class to properly handle nullable mailer names by changing from an empty string default to null.

Key Changes:

  • Added queue() and later() methods to PendingMail for queuing mail operations
  • Changed Mailable::$mailer property from string with empty string default to nullable ?string with null default
  • Updated MailFake::prepareMailableAndCallback() parameter type to accept callable|string|null

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/mail/src/PendingMail.php Added queue() and later() methods to support queuing mails through the pending mail interface
src/mail/src/Mailable.php Changed $mailer property and mailer() method to accept nullable string for better semantic representation
src/mail/src/Contracts/Mailable.php Updated interface to accept nullable mailer name in mailer() method
src/support/src/Testing/Fakes/MailFake.php Updated parameter type to accept string addresses in addition to callable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

/**
* Deliver the queued message after (n) seconds.
*/
public function later(DateTimeInterface|DateInterval|int $delay, MailableContract $mailable): mixed
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The parameter type order is inconsistent with the MailQueue interface and Mailer class implementation. The order should be DateInterval|DateTimeInterface|int instead of DateTimeInterface|DateInterval|int to match the interface definition and maintain consistency across the codebase.

Suggested change
public function later(DateTimeInterface|DateInterval|int $delay, MailableContract $mailable): mixed
public function later(DateInterval|DateTimeInterface|int $delay, MailableContract $mailable): mixed

Copilot uses AI. Check for mistakes.
@albertcht albertcht merged commit c455eea into main Nov 28, 2025
12 checks passed
@albertcht albertcht deleted the improve/pending-mail-queue branch November 28, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improved feature or adjustments.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants