Sim
Well-known member
If we want to swap out the Mail queue, it would be useful to have the public interface that the Mailer is going to use defined.
For example:
... and then the Queue class would become:
... and the constructor for the Mailer would typehint the
For example:
PHP:
<?php
namespace XF\Mail;
interface MailQueue
{
public function queue(\Swift_Mime_Message $message);
public function queueForRetry(\Swift_Mime_Message $message, $queueEntry);
}
... and then the Queue class would become:
PHP:
<?php
namespace XF\Mail;
class Queue implements MailQueue
{
...
}
... and the constructor for the Mailer would typehint the
XF\Mail\MailQueue
interface rather than the XF\Mail\Queue
class.
Upvote
6