From: Tim Düsterhus Date: Tue, 4 Oct 2022 14:19:50 +0000 (+0200) Subject: Use a PSR-7 stream in DebugEmailTransport X-Git-Tag: 6.0.0_Alpha_1~879 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9404aa33f3bbcd2b04560c92332eb694fcf749d4;p=GitHub%2FWoltLab%2FWCF.git Use a PSR-7 stream in DebugEmailTransport --- diff --git a/wcfsetup/install/files/lib/system/email/transport/DebugEmailTransport.class.php b/wcfsetup/install/files/lib/system/email/transport/DebugEmailTransport.class.php index bf97014bea..d4e066a2f5 100644 --- a/wcfsetup/install/files/lib/system/email/transport/DebugEmailTransport.class.php +++ b/wcfsetup/install/files/lib/system/email/transport/DebugEmailTransport.class.php @@ -2,9 +2,10 @@ namespace wcf\system\email\transport; +use Laminas\Diactoros\Stream; +use Psr\Http\Message\StreamInterface; use wcf\system\email\Email; use wcf\system\email\Mailbox; -use wcf\system\io\File; use wcf\util\DateUtil; /** @@ -19,32 +20,24 @@ use wcf\util\DateUtil; */ final class DebugEmailTransport implements IEmailTransport { - /** - * mbox file - * @var File - */ - protected $mbox; + protected StreamInterface $mbox; /** * Creates a new DebugTransport using the given mbox as target. * - * @param string $mbox mbox location or null for default location + * @param $mbox mbox location or null for default location */ - public function __construct($mbox = null) + public function __construct(?string $mbox = null) { if ($mbox === null) { $mbox = WCF_DIR . 'log/debug.mbox'; } - $this->mbox = new File($mbox, 'ab'); + $this->mbox = new Stream($mbox, 'ab'); } /** * Writes the given $email into the mbox. - * - * @param Email $email - * @param Mailbox $envelopeFrom - * @param Mailbox $envelopeTo */ public function deliver(Email $email, Mailbox $envelopeFrom, Mailbox $envelopeTo) {