Skip to content

Commit 6e51cda

Browse files
authored
Merge pull request #4 from screenfluent/fix/mailer-debug-check
fix: safely access debug config with null coalescing
2 parents a8a3f5e + c966a2d commit 6e51cda

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/Mail/Mailer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,12 @@ protected static function validate(Mail $mail)
124124
*/
125125
public static function send(Mail $mail)
126126
{
127-
if (static::$config['debug'] === "SERVER") {
127+
$debug = static::$config['debug'] ?? SMTP::DEBUG_OFF;
128+
129+
if ($debug === "SERVER") {
128130
static::$mailer->SMTPDebug = SMTP::DEBUG_SERVER;
129131
} else {
130-
static::$mailer->SMTPDebug = static::$config['debug'] ?? SMTP::DEBUG_OFF;
132+
static::$mailer->SMTPDebug = $debug;
131133
}
132134

133135
if (static::validate($mail)) {

0 commit comments

Comments
 (0)