From 21a7529a0ef570c68bb15d97adcbc82ba57d0b7b Mon Sep 17 00:00:00 2001 From: Art4 Date: Wed, 26 Feb 2025 15:21:19 +0000 Subject: [PATCH] fix PHPStan error in phpmailer addon --- phpmailer/phpmailer.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/phpmailer/phpmailer.php b/phpmailer/phpmailer.php index f4bb7753..10287a04 100644 --- a/phpmailer/phpmailer.php +++ b/phpmailer/phpmailer.php @@ -28,10 +28,14 @@ function phpmailer_load_config(ConfigFileManager $loader) } /** - * @param IEmail $email + * @param null|IEmail $email */ -function phpmailer_emailer_send_prepare(IEmail &$email) +function phpmailer_emailer_send_prepare(?IEmail &$email) { + if ($email === null) { + return; + } + // Passing `true` enables exceptions $mailer = new PHPMailer(true); try {