From c966a2de9cc5ec2147a9dbd460c55b7196956180 Mon Sep 17 00:00:00 2001 From: Szymon <04_barista_pads@icloud.com> Date: Wed, 27 Nov 2024 14:55:00 +0100 Subject: [PATCH] fix: safely access debug config with null coalescing --- src/Mail/Mailer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mail/Mailer.php b/src/Mail/Mailer.php index 53f6bc4..1e992a7 100644 --- a/src/Mail/Mailer.php +++ b/src/Mail/Mailer.php @@ -124,10 +124,12 @@ protected static function validate(Mail $mail) */ public static function send(Mail $mail) { - if (static::$config['debug'] === "SERVER") { + $debug = static::$config['debug'] ?? SMTP::DEBUG_OFF; + + if ($debug === "SERVER") { static::$mailer->SMTPDebug = SMTP::DEBUG_SERVER; } else { - static::$mailer->SMTPDebug = static::$config['debug'] ?? SMTP::DEBUG_OFF; + static::$mailer->SMTPDebug = $debug; } if (static::validate($mail)) {